Commit 16aff769 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

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: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 6065abf5
...@@ -339,6 +339,7 @@ static int ak4641_pcm_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -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; struct snd_soc_codec *codec = codec_dai->codec;
u8 btif; u8 btif;
int ret;
/* interface format */ /* interface format */
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
...@@ -358,7 +359,11 @@ static int ak4641_pcm_set_dai_fmt(struct snd_soc_dai *codec_dai, ...@@ -358,7 +359,11 @@ static int ak4641_pcm_set_dai_fmt(struct snd_soc_dai *codec_dai,
return -EINVAL; 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, static int ak4641_i2s_set_dai_fmt(struct snd_soc_dai *codec_dai,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment