[PATCH] power: regulator: Fix error code in regulator_list_autoset()

Patrice CHOTARD patrice.chotard at foss.st.com
Wed Jan 31 08:24:49 CET 2024



On 1/31/24 08:09, Dan Carpenter wrote:
> 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)


Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>

Thanks
Patrice


More information about the U-Boot mailing list