diff options
author | Jaehoon Chung <jh80.chung@samsung.com> | 2016-12-15 20:49:50 +0900 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2017-01-11 19:40:14 +0900 |
commit | 505cf4750ae55e711663538b3ec7a294c08e7417 (patch) | |
tree | 43f8c393b19f0946457b1beda94d228b1e6fc6e0 /drivers/power/power_core.c | |
parent | 9c720c815b1b1e95fb13153396417dddf323511d (diff) | |
download | u-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/power_core.c')
-rw-r--r-- | drivers/power/power_core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/power/power_core.c b/drivers/power/power_core.c index fe1f316..b72286d 100644 --- a/drivers/power/power_core.c +++ b/drivers/power/power_core.c @@ -23,7 +23,7 @@ int check_reg(struct pmic *p, u32 reg) if (reg >= p->number_of_regs) { printf("<reg num> = %d is invalid. Should be less than %d\n", reg, p->number_of_regs); - return -1; + return -EINVAL; } return 0; @@ -34,7 +34,7 @@ int pmic_set_output(struct pmic *p, u32 reg, int out, int on) u32 val; if (pmic_reg_read(p, reg, &val)) - return -1; + return -ENOTSUPP; if (on) val |= out; @@ -42,7 +42,7 @@ int pmic_set_output(struct pmic *p, u32 reg, int out, int on) val &= ~out; if (pmic_reg_write(p, reg, val)) - return -1; + return -ENOTSUPP; return 0; } @@ -59,7 +59,7 @@ static int pmic_dump(struct pmic *p) if (!p) { puts("Wrong PMIC name!\n"); - return -1; + return -ENODEV; } pmic_show_info(p); |