aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/pwm-regulator.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2015-06-05 14:42:46 -0400
committerMark Brown <broonie@kernel.org>2015-06-08 14:18:19 -0400
commitc779cebb7def3fd17aae5276f9a71f3c5237bc3f (patch)
tree2a5b576fb5a4a931fe349a702ef8af49b1bdd6e4 /drivers/regulator/pwm-regulator.c
parentb6f55e74d2babc0f6495c1e3fb12761388baa56f (diff)
regulator: pwm-regulator: Remove superfluous is_enabled check
The core framework already takes care of this. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/pwm-regulator.c')
-rw-r--r--drivers/regulator/pwm-regulator.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c
index a79b5bcfec1d..c2b86eb97dd2 100644
--- a/drivers/regulator/pwm-regulator.c
+++ b/drivers/regulator/pwm-regulator.c
@@ -23,7 +23,6 @@
23struct pwm_regulator_data { 23struct pwm_regulator_data {
24 struct pwm_voltages *duty_cycle_table; 24 struct pwm_voltages *duty_cycle_table;
25 struct pwm_device *pwm; 25 struct pwm_device *pwm;
26 bool enabled;
27 int state; 26 int state;
28}; 27};
29 28
@@ -60,13 +59,10 @@ static int pwm_regulator_set_voltage_sel(struct regulator_dev *dev,
60 59
61 drvdata->state = selector; 60 drvdata->state = selector;
62 61
63 if (!drvdata->enabled) { 62 ret = pwm_enable(drvdata->pwm);
64 ret = pwm_enable(drvdata->pwm); 63 if (ret) {
65 if (ret) { 64 dev_err(&dev->dev, "Failed to enable PWM\n");
66 dev_err(&dev->dev, "Failed to enable PWM\n"); 65 return ret;
67 return ret;
68 }
69 drvdata->enabled = true;
70 } 66 }
71 67
72 return 0; 68 return 0;