summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/bd71837-regulator.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2018-06-27 14:40:14 +0200
committerMark Brown <broonie@kernel.org>2018-06-27 16:45:29 +0200
commitffdc4984100050d0c8e2f11f76a15ca36f5d9e37 (patch)
tree43987847141c0314d526cf97f3a6d3ca73fe8741 /drivers/regulator/bd71837-regulator.c
parentregulator: bd71837: Staticize ldo_2_volts (diff)
downloadlinux-ffdc4984100050d0c8e2f11f76a15ca36f5d9e37.tar.xz
linux-ffdc4984100050d0c8e2f11f76a15ca36f5d9e37.zip
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>
Diffstat (limited to '')
-rw-r--r--drivers/regulator/bd71837-regulator.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/regulator/bd71837-regulator.c b/drivers/regulator/bd71837-regulator.c
index 403b45de1262..f57f42ed7160 100644
--- a/drivers/regulator/bd71837-regulator.c
+++ b/drivers/regulator/bd71837-regulator.c
@@ -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;
-
- ret = regulator_is_enabled_regmap(rdev);
- if (!ret)
- ret = regulator_set_voltage_sel_regmap(rdev, sel);
- else if (ret == 1)
- ret = -EBUSY;
- return ret;
+ if (regulator_is_enabled_regmap(rdev))
+ return -EBUSY;
+
+ return regulator_set_voltage_sel_regmap(rdev, sel);
}
static struct regulator_ops bd71837_ldo_regulator_ops = {