* [PATCH] power: twl4030-charger: Fix compiler warning with regulator_enable()
@ 2013-08-21 8:31 Peter Ujfalusi
2013-08-28 1:29 ` Anton Vorontsov
0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2013-08-21 8:31 UTC (permalink / raw)
To: Anton Vorontsov, David Woodhouse; +Cc: linux-kernel, Tony Lindgren, notasas
The return value of regulator_enable need to be checked. This patch fixes
the following warning:
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 [-Wunused-result]
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
drivers/power/twl4030_charger.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index be98e70..d98abe9 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -189,7 +189,12 @@ 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);
+ ret = regulator_enable(bci->usb_reg);
+ if (ret) {
+ dev_err(bci->dev,
+ "Failed to enable regulator\n");
+ return ret;
+ }
bci->usb_enabled = 1;
}
--
1.8.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-28 1:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21 8:31 [PATCH] power: twl4030-charger: Fix compiler warning with regulator_enable() Peter Ujfalusi
2013-08-28 1:29 ` Anton Vorontsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox