Re: [PATCH] gpio: winbond: Fix error code in winbond_gpio_get()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 23, 2022 at 11:29:48AM +0300, Dan Carpenter wrote:
> This error path returns 1, but it should instead propagate the negative
> error code from winbond_sio_enter().

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

> Fixes: a0d65009411c ("gpio: winbond: Add driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
>  drivers/gpio/gpio-winbond.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-winbond.c b/drivers/gpio/gpio-winbond.c
> index 7f8f5b02e31d..4b61d975cc0e 100644
> --- a/drivers/gpio/gpio-winbond.c
> +++ b/drivers/gpio/gpio-winbond.c
> @@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, unsigned int offset)
>  	unsigned long *base = gpiochip_get_data(gc);
>  	const struct winbond_gpio_info *info;
>  	bool val;
> +	int ret;
>  
>  	winbond_gpio_get_info(&offset, &info);
>  
> -	val = winbond_sio_enter(*base);
> -	if (val)
> -		return val;
> +	ret = winbond_sio_enter(*base);
> +	if (ret)
> +		return ret;
>  
>  	winbond_sio_select_logical(*base, info->dev);
>  
> -- 
> 2.35.1
> 

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux