Commit ad5ec6cd authored by Sachin Kamat's avatar Sachin Kamat Committed by Mark Brown

regulator: lp872x: Do not hardcode return values

Propagate the error values returned by the function instead.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 38dbfb59
...@@ -211,7 +211,7 @@ static int lp872x_get_timestep_usec(struct lp872x *lp) ...@@ -211,7 +211,7 @@ static int lp872x_get_timestep_usec(struct lp872x *lp)
ret = lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val); ret = lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val);
if (ret) if (ret)
return -EINVAL; return ret;
val = (val & mask) >> shift; val = (val & mask) >> shift;
if (val >= size) if (val >= size)
...@@ -229,7 +229,7 @@ static int lp872x_regulator_enable_time(struct regulator_dev *rdev) ...@@ -229,7 +229,7 @@ static int lp872x_regulator_enable_time(struct regulator_dev *rdev)
u8 addr, val; u8 addr, val;
if (time_step_us < 0) if (time_step_us < 0)
return -EINVAL; return time_step_us;
switch (rid) { switch (rid) {
case LP8720_ID_LDO1 ... LP8720_ID_BUCK: case LP8720_ID_LDO1 ... LP8720_ID_BUCK:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment