Skip to content

Commit

Permalink
gpio: winbond: Fix error code in winbond_gpio_get()
Browse files Browse the repository at this point in the history
[ Upstream commit 9ca766e ]

This error path returns 1, but it should instead propagate the negative
error code from winbond_sio_enter().

Fixes: a0d6500 ("gpio: winbond: Add driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Dan Carpenter authored and gregkh committed Jun 29, 2022
1 parent a84b26d commit 996ac8e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/gpio/gpio-winbond.c
Expand Up @@ -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);

Expand Down

0 comments on commit 996ac8e

Please sign in to comment.