Skip to content

Commit

Permalink
regulator: pwm-regulator: Remove superfluous is_enabled check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lee Jones authored and Mark Brown committed Jun 8, 2015
1 parent b6f55e7 commit c779ceb
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/regulator/pwm-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
struct pwm_regulator_data {
struct pwm_voltages *duty_cycle_table;
struct pwm_device *pwm;
bool enabled;
int state;
};

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c779ceb

Please sign in to comment.