Propagate the error values returned by the function instead.

Signed-off-by: Sachin Kamat <sachin.ka...@linaro.org>
---
 drivers/regulator/lp872x.c |    4 ++--
 1 file 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:
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to