aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/lp872x.c
diff options
context:
space:
mode:
authorSachin Kamat <sachin.kamat@linaro.org>2014-02-18 16:11:02 +0530
committerMark Brown <broonie@linaro.org>2014-02-20 01:26:02 +0900
commitad5ec6cdb2c409bf34db27c41d151bd307fac2a0 (patch)
treed94fbe1b5c0a09db967bccee434951a4bb97d172 /drivers/regulator/lp872x.c
parentLinus 3.14-rc1 (diff)
downloadlinux-dev-ad5ec6cdb2c409bf34db27c41d151bd307fac2a0.tar.xz
linux-dev-ad5ec6cdb2c409bf34db27c41d151bd307fac2a0.zip
regulator: lp872x: Do not hardcode return values
Propagate the error values returned by the function instead. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/lp872x.c')
-rw-r--r--drivers/regulator/lp872x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c
index 2e4734ff79fc..2e022aabd951 100644
--- a/drivers/regulator/lp872x.c
+++ b/drivers/regulator/lp872x.c
@@ -211,7 +211,7 @@ static int lp872x_get_timestep_usec(struct lp872x *lp)
ret = lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val);
if (ret)
- return -EINVAL;
+ return ret;
val = (val & mask) >> shift;
if (val >= size)
@@ -229,7 +229,7 @@ static int lp872x_regulator_enable_time(struct regulator_dev *rdev)
u8 addr, val;
if (time_step_us < 0)
- return -EINVAL;
+ return time_step_us;
switch (rid) {
case LP8720_ID_LDO1 ... LP8720_ID_BUCK: