Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sachin Kamat and committed by
Mark Brown
ad5ec6cd 38dbfb59

+2 -2
+2 -2
drivers/regulator/lp872x.c
··· 211 211 212 212 ret = lp872x_read_byte(lp, LP872X_GENERAL_CFG, &val); 213 213 if (ret) 214 - return -EINVAL; 214 + return ret; 215 215 216 216 val = (val & mask) >> shift; 217 217 if (val >= size) ··· 229 229 u8 addr, val; 230 230 231 231 if (time_step_us < 0) 232 - return -EINVAL; 232 + return time_step_us; 233 233 234 234 switch (rid) { 235 235 case LP8720_ID_LDO1 ... LP8720_ID_BUCK: