regulator: pwm-regulator: Remove superfluous is_enabled check
authorLee Jones <lee.jones@linaro.org>
Fri, 5 Jun 2015 18:42:46 +0000 (19:42 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 8 Jun 2015 18:18:19 +0000 (19:18 +0100)
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>
drivers/regulator/pwm-regulator.c

index a79b5bcfec1d7887b7a90ca1cba39138f0fb110e..c2b86eb97dd23f46c0980d45fc07c58f97825951 100644 (file)
@@ -23,7 +23,6 @@
 struct pwm_regulator_data {
        struct pwm_voltages *duty_cycle_table;
        struct pwm_device *pwm;
-       bool enabled;
        int state;
 };
 
@@ -60,13 +59,10 @@ static int pwm_regulator_set_voltage_sel(struct regulator_dev *dev,
 
        drvdata->state = selector;
 
-       if (!drvdata->enabled) {
-               ret = pwm_enable(drvdata->pwm);
-               if (ret) {
-                       dev_err(&dev->dev, "Failed to enable PWM\n");
-                       return ret;
-               }
-               drvdata->enabled = true;
+       ret = pwm_enable(drvdata->pwm);
+       if (ret) {
+               dev_err(&dev->dev, "Failed to enable PWM\n");
+               return ret;
        }
 
        return 0;