diff mbox series

[4/9] power: regulator: Handle autoset in regulators_enable_boot_on()

Message ID 20240605032521.1142768-5-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Bug-fixes for a few boards | expand

Commit Message

Simon Glass June 5, 2024, 3:25 a.m. UTC
With a recent change, regulators_enable_boot_on() returns an error if a
regulator is already set. Check for and handle this situation.

Fixes: d99fb64a98a power: regulator: Only run autoset once for each regulator

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 drivers/power/regulator/regulator-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Quentin Schulz June 5, 2024, 8:39 a.m. UTC | #1
Hi Simon,

On 6/5/24 5:25 AM, Simon Glass wrote:
> With a recent change, regulators_enable_boot_on() returns an error if a
> regulator is already set. Check for and handle this situation.
> 
> Fixes: d99fb64a98a power: regulator: Only run autoset once for each regulator
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin
Jonas Karlman June 5, 2024, 11:03 a.m. UTC | #2
Hi Simon,

On 2024-06-05 05:25, Simon Glass wrote:
> With a recent change, regulators_enable_boot_on() returns an error if a
> regulator is already set. Check for and handle this situation.

I am guessing this is being hit because of the call in veyron_init() ?

regulators_enable_boot_on() is also called for rockchip boards in the
rockchip common boards.c board_init().

Maybe the call to regulators_enable_boot_on() in veyron_init() could
be dropped?

> 
> Fixes: d99fb64a98a power: regulator: Only run autoset once for each regulator
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Reviewed-by: Jonas Karlman <jonas@kwiboo.se>

Regards,
Jonas

> ---
> 
>  drivers/power/regulator/regulator-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
> index 77d101f262e..d9e1fb68295 100644
> --- a/drivers/power/regulator/regulator-uclass.c
> +++ b/drivers/power/regulator/regulator-uclass.c
> @@ -518,7 +518,7 @@ int regulators_enable_boot_on(bool verbose)
>  	     dev;
>  	     uclass_next_device(&dev)) {
>  		ret = regulator_autoset(dev);
> -		if (ret == -EMEDIUMTYPE) {
> +		if (ret == -EMEDIUMTYPE || ret == -EALREADY) {
>  			ret = 0;
>  			continue;
>  		}
diff mbox series

Patch

diff --git a/drivers/power/regulator/regulator-uclass.c b/drivers/power/regulator/regulator-uclass.c
index 77d101f262e..d9e1fb68295 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -518,7 +518,7 @@  int regulators_enable_boot_on(bool verbose)
 	     dev;
 	     uclass_next_device(&dev)) {
 		ret = regulator_autoset(dev);
-		if (ret == -EMEDIUMTYPE) {
+		if (ret == -EMEDIUMTYPE || ret == -EALREADY) {
 			ret = 0;
 			continue;
 		}