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>
This commit is contained in:
parent
38dbfb59d1
commit
0b61ad1a7e
|
@ -361,7 +361,7 @@ static int wm8350_dcdc_set_suspend_voltage(struct regulator_dev *rdev, int uV)
|
||||||
|
|
||||||
sel = regulator_map_voltage_linear(rdev, uV, uV);
|
sel = regulator_map_voltage_linear(rdev, uV, uV);
|
||||||
if (sel < 0)
|
if (sel < 0)
|
||||||
return -EINVAL;
|
return sel;
|
||||||
|
|
||||||
/* all DCDCs have same mV bits */
|
/* all DCDCs have same mV bits */
|
||||||
val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_DC1_VSEL_MASK;
|
val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_DC1_VSEL_MASK;
|
||||||
|
@ -574,7 +574,7 @@ static int wm8350_ldo_set_suspend_voltage(struct regulator_dev *rdev, int uV)
|
||||||
|
|
||||||
sel = regulator_map_voltage_linear_range(rdev, uV, uV);
|
sel = regulator_map_voltage_linear_range(rdev, uV, uV);
|
||||||
if (sel < 0)
|
if (sel < 0)
|
||||||
return -EINVAL;
|
return sel;
|
||||||
|
|
||||||
/* all LDOs have same mV bits */
|
/* all LDOs have same mV bits */
|
||||||
val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_VSEL_MASK;
|
val = wm8350_reg_read(wm8350, volt_reg) & ~WM8350_LDO1_VSEL_MASK;
|
||||||
|
|
Loading…
Reference in New Issue