summaryrefslogtreecommitdiff
path: root/drivers/power/mfd
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2016-12-15 20:49:50 +0900
committerJaehoon Chung <jh80.chung@samsung.com>2017-01-11 19:40:14 +0900
commit505cf4750ae55e711663538b3ec7a294c08e7417 (patch)
tree43f8c393b19f0946457b1beda94d228b1e6fc6e0 /drivers/power/mfd
parent9c720c815b1b1e95fb13153396417dddf323511d (diff)
downloadu-boot-505cf4750ae55e711663538b3ec7a294c08e7417.tar.gz
u-boot-505cf4750ae55e711663538b3ec7a294c08e7417.tar.bz2
u-boot-505cf4750ae55e711663538b3ec7a294c08e7417.zip
power: change from meaningless value to error number
'-1' is absolutely meaningless value. This patch changed from meaningless value to error number. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/power/mfd')
-rw-r--r--drivers/power/mfd/fg_max77693.c4
-rw-r--r--drivers/power/mfd/pmic_max77693.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/power/mfd/fg_max77693.c b/drivers/power/mfd/fg_max77693.c
index 4519fed497..df1550816e 100644
--- a/drivers/power/mfd/fg_max77693.c
+++ b/drivers/power/mfd/fg_max77693.c
@@ -52,7 +52,7 @@ static int power_update_battery(struct pmic *p, struct pmic *bat)
if (pmic_probe(p)) {
puts("Can't find max77693 fuel gauge\n");
- return -1;
+ return -ENODEV;
}
ret = max77693_get_soc(&pb->bat->state_of_chrg);
@@ -74,7 +74,7 @@ static int power_check_battery(struct pmic *p, struct pmic *bat)
if (pmic_probe(p)) {
puts("Can't find max77693 fuel gauge\n");
- return -1;
+ return -ENODEV;
}
ret = pmic_reg_read(p, MAX77693_STATUS, &val);
diff --git a/drivers/power/mfd/pmic_max77693.c b/drivers/power/mfd/pmic_max77693.c
index 6b28e28b3f..c63390ed48 100644
--- a/drivers/power/mfd/pmic_max77693.c
+++ b/drivers/power/mfd/pmic_max77693.c
@@ -16,7 +16,7 @@ static int max77693_charger_state(struct pmic *p, int state, int current)
unsigned int val;
if (pmic_probe(p))
- return -1;
+ return -ENODEV;
/* unlock write capability */
val = MAX77693_CHG_UNLOCK;
@@ -27,13 +27,13 @@ static int max77693_charger_state(struct pmic *p, int state, int current)
pmic_reg_read(p, MAX77693_CHG_CNFG_00, &val);
val &= ~0x01;
pmic_reg_write(p, MAX77693_CHG_CNFG_00, val);
- return -1;
+ return -ENOTSUPP;
}
if (current < CHARGER_MIN_CURRENT || current > CHARGER_MAX_CURRENT) {
printf("%s: Wrong charge current: %d [mA]\n",
__func__, current);
- return -1;
+ return -EINVAL;
}
/* set charging current */
@@ -59,7 +59,7 @@ static int max77693_charger_bat_present(struct pmic *p)
unsigned int val;
if (pmic_probe(p))
- return -1;
+ return -ENODEV;
pmic_reg_read(p, MAX77693_CHG_INT_OK, &val);