Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] gpio: winbond: Fix error code in winbond_gpio_get()
@ 2022-06-23  8:29 Dan Carpenter
  2022-06-23  9:54 ` Andy Shevchenko
  2022-06-23 14:30 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2022-06-23  8:29 UTC (permalink / raw)
  To: Linus Walleij, Maciej S. Szmigiero
  Cc: Bartosz Golaszewski, Andy Shevchenko, linux-gpio, kernel-janitors

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 <dan.carpenter@oracle.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-23 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-23  8:29 [PATCH] gpio: winbond: Fix error code in winbond_gpio_get() Dan Carpenter
2022-06-23  9:54 ` Andy Shevchenko
2022-06-23 14:30 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox