Skip to contentSkip to conversation

ASoC: cs4270: Check that we can enable regulators on resume

PATCH In review Mark Brown 2 participants 5 messages Mar 19, 2012

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ASoC: cs4270: Check that we can enable regulators on resume

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.

---
 sound/soc/codecs/cs4270.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/cs4270.c +4 -2
index 1d672f5..15df950 100644
@@ -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. */
Signature · 1 line
1.7.9.1
#1 lore raw
Quoted 6 lines · Mark Brown

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.

---

CC sound/soc/codecs/cs4270.o
/home/b04825/git/alsa.guts/sound/soc/codecs/cs4270.c: In function 'cs4270_soc_resume':
/home/b04825/git/alsa.guts/sound/soc/codecs/cs4270.c:605:2: error: 'ret' undeclared (first use in this function) /home/b04825/git/alsa.guts/sound/soc/codecs/cs4270.c:605:2: note: each undeclared identifier is reported only once for each function it appears in

When I add 'int ret;', it compiles and works. Note, however, that I have no regular support on this board, so I don't know what I'm really testing.

On a side note, 'reg' should be an 'unsigned int', not an 'int'.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
author
#2 lore raw
Quoted 2 lines · Timur Tabi

When I add 'int ret;', it compiles and works. Note, however, that I have no regular support on this board, so I don't know what I'm really testing.

Oh, bah - I have that locally but not in the commit.

author
#3 lore raw
In reply to Timur Tabi
Quoted 2 lines · Timur Tabi

When I add 'int ret;', it compiles and works. Note, however, that I have no regular support on this board, so I don't know what I'm really testing.

I'll assume that's an ack for the fixed version, BTW...

#4 lore raw
Quoted 4 lines · Mark Brown
Quoted 2 lines
Quoted 2 lines

When I add 'int ret;', it compiles and works. Note, however, that I have no regular support on this board, so I don't know what I'm really testing.

I'll assume that's an ack for the fixed version, BTW...

Yes.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale