linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: neilb@suse.de (NeilBrown)
To: linux-arm-kernel@lists.infradead.org
Subject: Latest build results - errors/warnings - lots of them
Date: Mon, 6 May 2013 12:40:11 +1000	[thread overview]
Message-ID: <20130506124011.7e4c2806@notabene.brown> (raw)
In-Reply-To: <20130502153834.GR28721@atomide.com>

On Thu, 2 May 2013 08:38:34 -0700 Tony Lindgren <tony@atomide.com> wrote:

> > drivers/power/twl4030_charger.c: In function 'twl4030_charger_enable_usb':
> > drivers/power/twl4030_charger.c:192:20: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result
> 
> Neil, care to provide a fix for this? It's from your commit ab37813
> (twl4030_charger: Allow charger to control the regulator that feeds it).
> 
>
This the sort of thing that might be appropriate?

NeilBrown


From: NeilBrown <neilb@suse.de>
Date: Mon, 6 May 2013 12:35:59 +1000
Subject: [PATCH] twl4030_charger: don't ignore regulator_enable()

regulator_enable() doesn't like being ignored.  If it does fail there
is nothing we can do except not set usb_enabled (which is necessary
else a subsequent regulator_disable() will be unbalanced).

We cannot usefully return an error here as errors from
twl4030_charger_enable_usb() are ignored.

Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index bed4581..8b0ec70 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -189,8 +189,8 @@ static int twl4030_charger_enable_usb(struct twl4030_bci *bci, bool enable)
 
 		/* Need to keep regulator on */
 		if (!bci->usb_enabled) {
-			regulator_enable(bci->usb_reg);
-			bci->usb_enabled = 1;
+			if (regulator_enable(bci->usb_reg) == 0)
+				bci->usb_enabled = 1;
 		}
 
 		/* forcing the field BCIAUTOUSB (BOOT_BCI[1]) to 1 */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130506/119fb117/attachment.sig>

  parent reply	other threads:[~2013-05-06  2:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30  8:17 Latest build results - errors/warnings - lots of them Russell King - ARM Linux
2013-04-30 11:04 ` Arnd Bergmann
2013-04-30 11:43   ` Dave Martin
2013-04-30 11:54     ` Arnd Bergmann
2013-04-30 15:12     ` Nicolas Pitre
2013-04-30 17:28       ` Dave Martin
2013-04-30 18:18         ` Nicolas Pitre
2013-05-02  8:34           ` Russell King - ARM Linux
2013-05-02  9:46             ` Russell King - ARM Linux
2013-05-02 10:40               ` Dave Martin
2013-04-30 16:11   ` Tony Lindgren
2013-04-30 21:49     ` Tony Lindgren
2013-05-02  6:02   ` Shawn Guo
2013-04-30 23:11 ` Arnd Bergmann
2013-04-30 23:51   ` Tony Lindgren
2013-05-01  0:22     ` Tony Lindgren
2013-05-02  8:22 ` Russell King - ARM Linux
2013-05-02 15:38   ` Tony Lindgren
2013-05-02 17:07     ` Eduardo Valentin
2013-05-02 18:03       ` Arnd Bergmann
2013-05-02 18:45         ` Eduardo Valentin
2013-05-02 18:06       ` Felipe Balbi
2013-05-02 18:46         ` Eduardo Valentin
2013-05-02 18:54     ` Russell King - ARM Linux
2013-05-06  2:40     ` NeilBrown [this message]
2013-05-08 22:17       ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130506124011.7e4c2806@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).