aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-winbond.c
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2022-06-23 08:29:48 +0000
committerBartosz Golaszewski <[email protected]>2022-06-23 14:29:55 +0000
commit9ca766eaea2e87b8b773bff04ee56c055cb76d4e (patch)
tree49a54e8e97b4921dc55245114970f941841b8025 /drivers/gpio/gpio-winbond.c
parentgpio: realtek-otto: Make the irqchip immutable (diff)
downloadkernel-9ca766eaea2e87b8b773bff04ee56c055cb76d4e.tar.gz
kernel-9ca766eaea2e87b8b773bff04ee56c055cb76d4e.zip
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: a0d65009411c ("gpio: winbond: Add driver") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-winbond.c')
-rw-r--r--drivers/gpio/gpio-winbond.c7
1 files 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);