[PATCH] power: regulator: Fix error code in regulator_list_autoset()
Dan Carpenter
dan.carpenter at linaro.org
Wed Jan 31 08:09:41 CET 2024
This condition has a bitwise & vs logical && typo so it only preserves
odd number error codes.
Fixes: 3b880757abca ("dm: regulator: uclass driver code cleanup")
Signed-off-by: Dan Carpenter <dan.carpenter at linaro.org>
---
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 77d101f262e2..de2bb3b1cd88 100644
--- a/drivers/power/regulator/regulator-uclass.c
+++ b/drivers/power/regulator/regulator-uclass.c
@@ -390,7 +390,7 @@ int regulator_list_autoset(const char *list_platname[],
ret = regulator_autoset_by_name(list_platname[i], &dev);
if (ret != -EMEDIUMTYPE && verbose)
regulator_show(dev, ret);
- if (ret & !error)
+ if (ret && !error)
error = ret;
if (list_devp)
--
2.43.0
More information about the U-Boot
mailing list