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>
This commit is contained in:
Lee Jones 2015-06-05 19:42:46 +01:00 committed by Mark Brown
parent b6f55e74d2
commit c779cebb7d
1 changed files with 4 additions and 8 deletions

View 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;