Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] ASoC: max98090: Check for clk_prepare_enable() error
@ 2015-06-20 18:55 Fabio Estevam
  2015-06-20 18:55 ` [PATCH 2/4] ASoC: wm8904: " Fabio Estevam
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fabio Estevam @ 2015-06-20 18:55 UTC (permalink / raw)
  To: broonie; +Cc: Fabio Estevam, alsa-devel

From: Fabio Estevam <fabio.estevam@freescale.com>

clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/codecs/max98090.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index 78268f05..1697340 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -1801,10 +1801,13 @@ static int max98090_set_bias_level(struct snd_soc_codec *codec,
 		if (IS_ERR(max98090->mclk))
 			break;
 
-		if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON)
+		if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_ON) {
 			clk_disable_unprepare(max98090->mclk);
-		else
-			clk_prepare_enable(max98090->mclk);
+		} else {
+			ret = clk_prepare_enable(max98090->mclk);
+			if (ret)
+				return ret;
+		}
 		break;
 
 	case SND_SOC_BIAS_STANDBY:
-- 
1.9.1

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

end of thread, other threads:[~2015-07-07 18:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-20 18:55 [PATCH 1/4] ASoC: max98090: Check for clk_prepare_enable() error Fabio Estevam
2015-06-20 18:55 ` [PATCH 2/4] ASoC: wm8904: " Fabio Estevam
2015-06-20 18:55 ` [PATCH 3/4] ASoC: wm8731: " Fabio Estevam
2015-06-20 18:55 ` [PATCH 4/4] ASoC: max98095: " Fabio Estevam
2015-07-07 18:30 ` Applied "ASoC: max98090: Check for clk_prepare_enable() error" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox