Skip to content

Commit

Permalink
ASoC: Fix return value of ak4641_pcm_set_dai_fmt()
Browse files Browse the repository at this point in the history
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 <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jan 2, 2012
1 parent 6065abf commit 16aff76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sound/soc/codecs/ak4641.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
Expand Down

0 comments on commit 16aff76

Please sign in to comment.