From: Axel Lin Date: Fri, 30 Dec 2011 15:34:54 +0000 (+0800) Subject: ASoC: Fix return value of ak4641_pcm_set_dai_fmt() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=16aff769d73c6b66a79450d7218f31dc46962536;p=openwrt%2Fstaging%2Fblogic.git ASoC: Fix return value of ak4641_pcm_set_dai_fmt() We can't just pass back the return value of snd_soc_update_bits() as it will be 1 if a bit changed rather than zero. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c index 266ebea2b65a..c4d165a4bddf 100644 --- a/sound/soc/codecs/ak4641.c +++ b/sound/soc/codecs/ak4641.c @@ -339,6 +339,7 @@ static int ak4641_pcm_set_dai_fmt(struct snd_soc_dai *codec_dai, { struct snd_soc_codec *codec = codec_dai->codec; u8 btif; + int ret; /* interface format */ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { @@ -358,7 +359,11 @@ static int ak4641_pcm_set_dai_fmt(struct snd_soc_dai *codec_dai, return -EINVAL; } - return snd_soc_update_bits(codec, AK4641_BTIF, (0x3 << 5), btif); + ret = snd_soc_update_bits(codec, AK4641_BTIF, (0x3 << 5), btif); + if (ret < 0) + return ret; + + return 0; } static int ak4641_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai,