[alsa-devel] [PATCH] ASoC: cs4270: Check that we can enable regulators on resume

Mark Brown broonie at opensource.wolfsonmicro.com
Mon Mar 19 17:16:17 CET 2012


It's possible that the regulator enable will fail and if it does we may
as well just give up with trying to bring the rest of the device up and
report the original error.

Signed-off-by: Mark Brown <broonie at opensource.wolfsonmicro.com>
---
 sound/soc/codecs/cs4270.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index 1d672f5..15df950 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -602,8 +602,10 @@ static int cs4270_soc_resume(struct snd_soc_codec *codec)
 	struct cs4270_private *cs4270 = snd_soc_codec_get_drvdata(codec);
 	int reg;
 
-	regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
-			      cs4270->supplies);
+	ret = regulator_bulk_enable(ARRAY_SIZE(cs4270->supplies),
+				    cs4270->supplies);
+	if (ret != 0)
+		return ret;
 
 	/* In case the device was put to hard reset during sleep, we need to
 	 * wait 500ns here before any I2C communication. */
-- 
1.7.9.1



More information about the Alsa-devel mailing list