alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: alsa-devel@alsa-project.org
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>,
	Mark@alsa-project.org
Subject: [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt()
Date: Fri, 30 Dec 2011 23:34:54 +0800	[thread overview]
Message-ID: <1325259294.4755.1.camel@phoenix> (raw)

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>
---
 sound/soc/codecs/ak4641.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c
index 266ebea..c4d165a 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,
-- 
1.7.5.4

             reply	other threads:[~2011-12-30 15:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-30 15:34 Axel Lin [this message]
2011-12-30 15:36 ` [PATCH 2/3] ASoC: Fix return value of wm8580_set_sysclk() Axel Lin
2011-12-30 15:38 ` [PATCH 3/3] ASoC: Fix return value of wm8962_gpio_direction_out() Axel Lin
2012-01-02 12:44 ` [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt() Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1325259294.4755.1.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=Mark@alsa-project.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=lars@metafoo.de \
    --cc=lrg@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).