summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/ab8500_charger.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/supply/ab8500_charger.c')
-rw-r--r--drivers/power/supply/ab8500_charger.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 9b34d1a60f..4b0ad1b4b4 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -488,8 +488,10 @@ static int ab8500_charger_get_ac_voltage(struct ab8500_charger *di)
/* Only measure voltage if the charger is connected */
if (di->ac.charger_connected) {
ret = iio_read_channel_processed(di->adc_main_charger_v, &vch);
- if (ret < 0)
+ if (ret < 0) {
dev_err(di->dev, "%s ADC conv failed,\n", __func__);
+ return ret;
+ }
} else {
vch = 0;
}
@@ -540,8 +542,10 @@ static int ab8500_charger_get_vbus_voltage(struct ab8500_charger *di)
/* Only measure voltage if the charger is connected */
if (di->usb.charger_connected) {
ret = iio_read_channel_processed(di->adc_vbus_v, &vch);
- if (ret < 0)
+ if (ret < 0) {
dev_err(di->dev, "%s ADC conv failed,\n", __func__);
+ return ret;
+ }
} else {
vch = 0;
}
@@ -563,8 +567,10 @@ static int ab8500_charger_get_usb_current(struct ab8500_charger *di)
/* Only measure current if the charger is online */
if (di->usb.charger_online) {
ret = iio_read_channel_processed(di->adc_usb_charger_c, &ich);
- if (ret < 0)
+ if (ret < 0) {
dev_err(di->dev, "%s ADC conv failed,\n", __func__);
+ return ret;
+ }
} else {
ich = 0;
}
@@ -586,8 +592,10 @@ static int ab8500_charger_get_ac_current(struct ab8500_charger *di)
/* Only measure current if the charger is online */
if (di->ac.charger_online) {
ret = iio_read_channel_processed(di->adc_main_charger_c, &ich);
- if (ret < 0)
+ if (ret < 0) {
dev_err(di->dev, "%s ADC conv failed,\n", __func__);
+ return ret;
+ }
} else {
ich = 0;
}