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

Tom Rini trini at konsulko.com
Fri Sep 6 05:07:40 CEST 2024


On Wed, Jan 31, 2024 at 10:09:41AM +0300, 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>
> Reviewed-by: Patrice Chotard <patrice.chotard at foss.st.com>
> ---
>  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)

Unfortunately this then leads to the (likely incorrect) test failing:
https://source.denx.de/u-boot/u-boot/-/jobs/898197#L290

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20240905/a92a4366/attachment.sig>


More information about the U-Boot mailing list