2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 22:24:09 +08:00

regulator: bd71837: Simplify bd71837_set_voltage_sel_restricted implementation

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Axel Lin 2018-06-27 20:40:14 +08:00 committed by Mark Brown
parent adb78a8e24
commit ffdc498410
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -73,14 +73,10 @@ static int bd71837_buck1234_set_ramp_delay(struct regulator_dev *rdev,
static int bd71837_set_voltage_sel_restricted(struct regulator_dev *rdev,
unsigned int sel)
{
int ret;
if (regulator_is_enabled_regmap(rdev))
return -EBUSY;
ret = regulator_is_enabled_regmap(rdev);
if (!ret)
ret = regulator_set_voltage_sel_regmap(rdev, sel);
else if (ret == 1)
ret = -EBUSY;
return ret;
return regulator_set_voltage_sel_regmap(rdev, sel);
}
static struct regulator_ops bd71837_ldo_regulator_ops = {