Skip to content

Commit 9ca766e

Browse files
Dan Carpenterbrgl
authored andcommitted
gpio: winbond: Fix error code in winbond_gpio_get()
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 <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent a01a40e commit 9ca766e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpio/gpio-winbond.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,13 @@ static int winbond_gpio_get(struct gpio_chip *gc, unsigned int offset)
385385
unsigned long *base = gpiochip_get_data(gc);
386386
const struct winbond_gpio_info *info;
387387
bool val;
388+
int ret;
388389

389390
winbond_gpio_get_info(&offset, &info);
390391

391-
val = winbond_sio_enter(*base);
392-
if (val)
393-
return val;
392+
ret = winbond_sio_enter(*base);
393+
if (ret)
394+
return ret;
394395

395396
winbond_sio_select_logical(*base, info->dev);
396397

0 commit comments

Comments
 (0)