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>
This commit is contained in:
Sachin Kamat 2014-02-18 16:11:02 +05:30 committed by Mark Brown
parent 38dbfb59d1
commit ad5ec6cdb2
1 changed files with 2 additions and 2 deletions

View File

@ -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: