summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2013-08-21 11:31:37 +0300
committerAnton Vorontsov <anton@enomsg.org>2013-08-27 18:28:30 -0700
commit697be361d2b3fd7760869341d7ce805092a5c1e5 (patch)
tree46cabb187ca72f7046a2c0d1be53f38dbbefe83a
parent8e2747f031bd322d0fc25e0338ef50d4c18843d4 (diff)
downloadlinux-697be361d2b3fd7760869341d7ce805092a5c1e5.tar.bz2
twl4030-charger: Fix compiler warning with regulator_enable()
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> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
-rw-r--r--drivers/power/twl4030_charger.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index be98e70380f9..d98abe911e37 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;
}