alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt()
@ 2011-12-30 15:34 Axel Lin
  2011-12-30 15:36 ` [PATCH 2/3] ASoC: Fix return value of wm8580_set_sysclk() Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Axel Lin @ 2011-12-30 15:34 UTC (permalink / raw)
  To: alsa-devel; +Cc: Lars-Peter Clausen, Brown, Liam Girdwood, Mark

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] ASoC: Fix return value of wm8580_set_sysclk()
  2011-12-30 15:34 [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt() Axel Lin
@ 2011-12-30 15:36 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2011-12-30 15:36 UTC (permalink / raw)
  To: alsa-devel; +Cc: Dimitris Papastamos, Mark Brown, Liam Girdwood

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/wm8580.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c
index b1c8d3d..2112851 100644
--- a/sound/soc/codecs/wm8580.c
+++ b/sound/soc/codecs/wm8580.c
@@ -670,7 +670,7 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 {
 	struct snd_soc_codec *codec = dai->codec;
 	struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
-	int sel, sel_mask, sel_shift;
+	int ret, sel, sel_mask, sel_shift;
 
 	switch (dai->driver->id) {
 	case WM8580_DAI_PAIFRX:
@@ -711,7 +711,11 @@ static int wm8580_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 	/* We really should validate PLL settings but not yet */
 	wm8580->sysclk[dai->driver->id] = freq;
 
-	return snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel);
+	ret = snd_soc_update_bits(codec, WM8580_CLKSEL, sel_mask, sel);
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }
 
 static int wm8580_digital_mute(struct snd_soc_dai *codec_dai, int mute)
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] ASoC: Fix return value of wm8962_gpio_direction_out()
  2011-12-30 15:34 [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt() Axel Lin
  2011-12-30 15:36 ` [PATCH 2/3] ASoC: Fix return value of wm8580_set_sysclk() Axel Lin
@ 2011-12-30 15:38 ` Axel Lin
  2012-01-02 12:44 ` [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt() Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Axel Lin @ 2011-12-30 15:38 UTC (permalink / raw)
  To: alsa-devel; +Cc: Dimitris Papastamos, Mark Brown, Liam Girdwood

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/wm8962.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
index be35b64..80e8b9f 100644
--- a/sound/soc/codecs/wm8962.c
+++ b/sound/soc/codecs/wm8962.c
@@ -3878,13 +3878,17 @@ static int wm8962_gpio_direction_out(struct gpio_chip *chip,
 {
 	struct wm8962_priv *wm8962 = gpio_to_wm8962(chip);
 	struct snd_soc_codec *codec = wm8962->codec;
-	int val;
+	int ret, val;
 
 	/* Force function 1 (logic output) */
 	val = (1 << WM8962_GP2_FN_SHIFT) | (value << WM8962_GP2_LVL_SHIFT);
 
-	return snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset,
-				   WM8962_GP2_FN_MASK | WM8962_GP2_LVL, val);
+	ret = snd_soc_update_bits(codec, WM8962_GPIO_BASE + offset,
+				  WM8962_GP2_FN_MASK | WM8962_GP2_LVL, val);
+	if (ret < 0)
+		return ret;
+
+	return 0;
 }
 
 static struct gpio_chip wm8962_template_chip = {
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt()
  2011-12-30 15:34 [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt() Axel Lin
  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 ` Mark Brown
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-01-02 12:44 UTC (permalink / raw)
  To: Axel Lin; +Cc: alsa-devel, Lars-Peter Clausen, Liam Girdwood

On Fri, Dec 30, 2011 at 11:34:54PM +0800, Axel Lin wrote:
> 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.

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-02 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-30 15:34 [PATCH 1/3] ASoC: Fix return value of ak4641_pcm_set_dai_fmt() Axel Lin
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

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).