summaryrefslogtreecommitdiff
path: root/drivers/power/pmic/pmic_max8997.c
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/pmic/pmic_max8997.c
parent9c720c815b1b1e95fb13153396417dddf323511d (diff)
downloadu-boot-imx-505cf4750ae55e711663538b3ec7a294c08e7417.zip
u-boot-imx-505cf4750ae55e711663538b3ec7a294c08e7417.tar.gz
u-boot-imx-505cf4750ae55e711663538b3ec7a294c08e7417.tar.bz2
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/pmic/pmic_max8997.c')
-rw-r--r--drivers/power/pmic/pmic_max8997.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/power/pmic/pmic_max8997.c b/drivers/power/pmic/pmic_max8997.c
index a36a9a0..32afb3f 100644
--- a/drivers/power/pmic/pmic_max8997.c
+++ b/drivers/power/pmic/pmic_max8997.c
@@ -33,7 +33,7 @@ static int pmic_charger_state(struct pmic *p, int state, int current)
u32 val = 0;
if (pmic_probe(p))
- return -1;
+ return -ENODEV;
if (state == PMIC_CHARGER_DISABLE) {
puts("Disable the charger.\n");
@@ -41,13 +41,13 @@ static int pmic_charger_state(struct pmic *p, int state, int current)
val &= ~(MBCHOSTEN | VCHGR_FC);
pmic_reg_write(p, MAX8997_REG_MBCCTRL2, 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;
}
fc = (current - CHARGER_MIN_CURRENT) / CHARGER_CURRENT_RESOLUTION;
@@ -71,7 +71,7 @@ static int pmic_charger_bat_present(struct pmic *p)
u32 val;
if (pmic_probe(p))
- return -1;
+ return -ENODEV;
pmic_reg_read(p, MAX8997_REG_STATUS4, &val);