Skip to contentSkip to conversation

ASoC: max98090: Check for clk_prepare_enable() error

PATCH Superseded Fabio Estevam 2 participants 5 messages Jun 20, 2015 – Jul 7, 2015

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 ASoC: max98090: Check for clk_prepare_enable() error

From: Fabio Estevam <[email protected]>

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

---
 sound/soc/codecs/max98090.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
sound/soc/codecs/max98090.c +6 -3
index 78268f05..1697340 100644
@@ -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:
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/4 ASoC: wm8904: Check for clk_prepare_enable() error

From: Fabio Estevam <[email protected]>

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

---
 sound/soc/codecs/wm8904.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/codecs/wm8904.c +3 -1
index 265a4a5..07dc400 100644
@@ -1837,7 +1837,9 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,
 
 	switch (level) {
 	case SND_SOC_BIAS_ON:
-		clk_prepare_enable(wm8904->mclk);
+		ret = clk_prepare_enable(wm8904->mclk);
+		if (ret)
+			return ret;
 		break;
 
 	case SND_SOC_BIAS_PREPARE:
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/4 ASoC: wm8731: Check for clk_prepare_enable() error

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

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

---
 sound/soc/codecs/wm8731.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8731.c +5 -2
index 915ea11..3f87e7d 100644
@@ -496,8 +496,11 @@ static int wm8731_set_bias_level(struct snd_soc_codec *codec,
 
 	switch (level) {
 	case SND_SOC_BIAS_ON:
-		if (wm8731->mclk)
-			clk_prepare_enable(wm8731->mclk);
+		if (wm8731->mclk) {
+			ret = clk_prepare_enable(wm8731->mclk);
+			if (ret)
+				return ret;
+		}
 		break;
 	case SND_SOC_BIAS_PREPARE:
 		break;
Signature · 1 line
1.9.1
#3 lore raw

PATCH 4/4 ASoC: max98095: Check for clk_prepare_enable() error

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

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

---
 sound/soc/codecs/max98095.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
sound/soc/codecs/max98095.c +6 -3
index 9a46d3d..66afd2b 100644
@@ -1653,10 +1653,13 @@ static int max98095_set_bias_level(struct snd_soc_codec *codec,
 		if (IS_ERR(max98095->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(max98095->mclk);
-		else
-			clk_prepare_enable(max98095->mclk);
+		} else {
+			ret = clk_prepare_enable(max98095->mclk);
+			if (ret)
+				return ret;
+		}
 		break;
 
 	case SND_SOC_BIAS_STANDBY:
Signature · 1 line
1.9.1
maintainer
#4 lore raw

Applied "ASoC: max98090: Check for clk_prepare_enable() error" to the asoc tree

In reply to Fabio Estevam

The patch

ASoC: max98090: Check for clk_prepare_enable() error

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 9acc7f08716b98730e1ead7e785fb0f3ad3a2d07 Mon Sep 17 00:00:00 2001

From: Fabio Estevam <[email protected]>
Date: Sat, 20 Jun 2015 15:55:50 -0300
Subject: [PATCH] ASoC: max98090: Check for clk_prepare_enable() error

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

---
 sound/soc/codecs/max98090.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
sound/soc/codecs/max98090.c +6 -3
index 78268f0514e9..1697340c3842 100644
@@ -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:
Signature · 1 line
2.1.4