alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs4270: Check that we can enable regulators on resume
@ 2012-03-19 16:16 Mark Brown
  2012-03-19 17:46 ` Timur Tabi
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-03-19 16:16 UTC (permalink / raw)
  To: Timur Tabi, Liam Girdwood; +Cc: alsa-devel, 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.

Signed-off-by: Mark Brown <broonie@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

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

* Re: [PATCH] ASoC: cs4270: Check that we can enable regulators on resume
  2012-03-19 16:16 [PATCH] ASoC: cs4270: Check that we can enable regulators on resume Mark Brown
@ 2012-03-19 17:46 ` Timur Tabi
  2012-03-19 17:53   ` Mark Brown
  2012-03-19 18:37   ` Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Timur Tabi @ 2012-03-19 17:46 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

Mark Brown wrote:
> 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@opensource.wolfsonmicro.com>
> ---

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

-- 
Timur Tabi
Linux kernel developer at Freescale

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

* Re: [PATCH] ASoC: cs4270: Check that we can enable regulators on resume
  2012-03-19 17:46 ` Timur Tabi
@ 2012-03-19 17:53   ` Mark Brown
  2012-03-19 18:37   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2012-03-19 17:53 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, Liam Girdwood

On Mon, Mar 19, 2012 at 12:46:24PM -0500, Timur Tabi wrote:

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

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

* Re: [PATCH] ASoC: cs4270: Check that we can enable regulators on resume
  2012-03-19 17:46 ` Timur Tabi
  2012-03-19 17:53   ` Mark Brown
@ 2012-03-19 18:37   ` Mark Brown
  2012-03-19 18:38     ` Timur Tabi
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2012-03-19 18:37 UTC (permalink / raw)
  To: Timur Tabi; +Cc: alsa-devel, Liam Girdwood


[-- Attachment #1.1: Type: text/plain, Size: 271 bytes --]

On Mon, Mar 19, 2012 at 12:46:24PM -0500, Timur Tabi wrote:

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

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



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

* Re: [PATCH] ASoC: cs4270: Check that we can enable regulators on resume
  2012-03-19 18:37   ` Mark Brown
@ 2012-03-19 18:38     ` Timur Tabi
  0 siblings, 0 replies; 5+ messages in thread
From: Timur Tabi @ 2012-03-19 18:38 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, Liam Girdwood

Mark Brown wrote:
>> > 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.

-- 
Timur Tabi
Linux kernel developer at Freescale

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

end of thread, other threads:[~2012-03-19 18:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-19 16:16 [PATCH] ASoC: cs4270: Check that we can enable regulators on resume Mark Brown
2012-03-19 17:46 ` Timur Tabi
2012-03-19 17:53   ` Mark Brown
2012-03-19 18:37   ` Mark Brown
2012-03-19 18:38     ` Timur Tabi

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