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

regulator: wm8350: Do not hardcode return value

Propagate the error value 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
0b61ad1a 38dbfb59

+2 -2
+2 -2
drivers/regulator/wm8350-regulator.c
··· 361 361 362 362 sel = regulator_map_voltage_linear(rdev, uV, uV); 363 363 if (sel < 0) 364 - return -EINVAL; 364 + return sel; 365 365 366 366 /* all DCDCs have same mV bits */ 367 367 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_DC1_VSEL_MASK; ··· 574 574 575 575 sel = regulator_map_voltage_linear_range(rdev, uV, uV); 576 576 if (sel < 0) 577 - return -EINVAL; 577 + return sel; 578 578 579 579 /* all LDOs have same mV bits */ 580 580 val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_VSEL_MASK;