]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
power: pwm_regulator: remove redundant code
authorKever Yang <kever.yang@rock-chips.com>
Wed, 19 Jul 2017 11:54:22 +0000 (19:54 +0800)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Thu, 27 Jul 2017 12:59:01 +0000 (14:59 +0200)
The regulator_enable() should be called from upper layer like
regulators_enable_boot_on(), remove it from pwm regulator driver.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
[fixed up typo in commit message:]
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
drivers/power/regulator/pwm_regulator.c

index fcf5e00837247f15441d3bc45ee14f10d02410f3..b63f941990d512b2a3c94e1af9d26f6a92863648 100644 (file)
@@ -86,12 +86,8 @@ static int pwm_regulator_set_voltage(struct udevice *dev, int uvolt)
                return ret;
        }
 
-       ret = pwm_set_enable(priv->pwm, priv->pwm_id, true);
-       if (ret) {
-               dev_err(dev, "Failed to enable PWM\n");
-               return ret;
-       }
        priv->volt_uV = uvolt;
+
        return ret;
 }
 
@@ -144,8 +140,6 @@ static int pwm_regulator_probe(struct udevice *dev)
        if (priv->init_voltage)
                pwm_regulator_set_voltage(dev, priv->init_voltage);
 
-       pwm_regulator_enable(dev, 1);
-
        return 0;
 }