]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
power: regulator: Handle autoset in regulators_enable_boot_on()
authorSimon Glass <sjg@chromium.org>
Thu, 27 Jun 2024 08:29:46 +0000 (09:29 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 28 Jun 2024 19:54:52 +0000 (13:54 -0600)
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
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
drivers/power/regulator/regulator-uclass.c

index 77d101f262e2708ee5a8ea9375860b099c0814f2..d9e1fb68295a2bd0aeb6b225b6ae797350db2a66 100644 (file)
@@ -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;
                }