diff options
author | Sachin Kamat <sachin.kamat@linaro.org> | 2013-09-06 04:01:09 -0400 |
---|---|---|
committer | Anton Vorontsov <anton@enomsg.org> | 2013-10-25 18:36:05 -0400 |
commit | 6de7ef3e309acb1e55ae122b85a2665064832b0c (patch) | |
tree | 6429d3075d031c1070efe4587fc40949954250f8 /drivers/power | |
parent | f07c11ea32eebf81b7c1e59da2d119bf023882f2 (diff) |
ab8500-charger: Check return value of regulator_enable
Check the return value of regulator_enable to silence the following
type of warnings:
drivers/power/ab8500_charger.c:1390:20: warning: ignoring return value
of ‘regulator_enable’, declared with attribute warn_unused_result
[-Wunused-result]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/ab8500_charger.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index a4c4a10b3a41..fd350189b632 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c | |||
@@ -1387,8 +1387,12 @@ static int ab8500_charger_ac_en(struct ux500_charger *charger, | |||
1387 | * the GPADC module independant of the AB8500 chargers | 1387 | * the GPADC module independant of the AB8500 chargers |
1388 | */ | 1388 | */ |
1389 | if (!di->vddadc_en_ac) { | 1389 | if (!di->vddadc_en_ac) { |
1390 | regulator_enable(di->regu); | 1390 | ret = regulator_enable(di->regu); |
1391 | di->vddadc_en_ac = true; | 1391 | if (ret) |
1392 | dev_warn(di->dev, | ||
1393 | "Failed to enable regulator\n"); | ||
1394 | else | ||
1395 | di->vddadc_en_ac = true; | ||
1392 | } | 1396 | } |
1393 | 1397 | ||
1394 | /* Check if the requested voltage or current is valid */ | 1398 | /* Check if the requested voltage or current is valid */ |
@@ -1556,8 +1560,12 @@ static int ab8500_charger_usb_en(struct ux500_charger *charger, | |||
1556 | * the GPADC module independant of the AB8500 chargers | 1560 | * the GPADC module independant of the AB8500 chargers |
1557 | */ | 1561 | */ |
1558 | if (!di->vddadc_en_usb) { | 1562 | if (!di->vddadc_en_usb) { |
1559 | regulator_enable(di->regu); | 1563 | ret = regulator_enable(di->regu); |
1560 | di->vddadc_en_usb = true; | 1564 | if (ret) |
1565 | dev_warn(di->dev, | ||
1566 | "Failed to enable regulator\n"); | ||
1567 | else | ||
1568 | di->vddadc_en_usb = true; | ||
1561 | } | 1569 | } |
1562 | 1570 | ||
1563 | /* Enable USB charging */ | 1571 | /* Enable USB charging */ |