diff mbox

[U-Boot,3/4] power: pwm_regulator: remove redundance code

Message ID 1500465263-25544-3-git-send-email-kever.yang@rock-chips.com
State Accepted
Commit 3030c951f19bf69fd12fe700d33c4be3ad2ee734
Delegated to: Philipp Tomsich
Headers show

Commit Message

Kever Yang July 19, 2017, 11:54 a.m. UTC
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>
---

 drivers/power/regulator/pwm_regulator.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Philipp Tomsich July 19, 2017, 12:42 p.m. UTC | #1
> 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>
> ---
> 
>  drivers/power/regulator/pwm_regulator.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Philipp Tomsich July 26, 2017, 4:52 p.m. UTC | #2
> 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>
> ---
> 
>  drivers/power/regulator/pwm_regulator.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Philipp Tomsich July 27, 2017, 8:32 a.m. UTC | #3
> 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>
> ---
> 
>  drivers/power/regulator/pwm_regulator.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 

Applied to u-boot-rockchip, thanks!
Simon Glass July 27, 2017, 3:13 p.m. UTC | #4
On 19 July 2017 at 05:54, Kever Yang <kever.yang@rock-chips.com> wrote:
> 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>
> ---
>
>  drivers/power/regulator/pwm_regulator.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/drivers/power/regulator/pwm_regulator.c b/drivers/power/regulator/pwm_regulator.c
index fcf5e00..b63f941 100644
--- a/drivers/power/regulator/pwm_regulator.c
+++ b/drivers/power/regulator/pwm_regulator.c
@@ -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;
 }