twl4030-charger: Fix compiler warning with regulator_enable()
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Wed, 21 Aug 2013 08:31:37 +0000 (11:31 +0300)
committerAnton Vorontsov <anton@enomsg.org>
Wed, 28 Aug 2013 01:28:30 +0000 (18:28 -0700)
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>
drivers/power/twl4030_charger.c

index be98e70380f9750a8b256b473e40622091475d53..d98abe911e376cc69f187c53caae17a979d812d8 100644 (file)
@@ -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;
                }