Skip to content

Commit 471e998

Browse files
author
Bartosz Golaszewski
committed
gpiolib: remove redundant callback check
The presence of the .get_direction() callback is already checked in gpiochip_get_direction(). Remove the duplicated check which also returns the wrong error code to user-space. Fixes: e623c43 ("gpiolib: sanitize the return value of gpio_chip::get_direction()") Reported-by: Michael Walle <mwalle@kernel.org> Closes: https://lore.kernel.org/all/DFJAFK3DTBOZ.3G2P3A5IH34GF@kernel.org/ Link: https://lore.kernel.org/r/20260109105557.20024-1-bartosz.golaszewski@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent c187900 commit 471e998

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

drivers/gpio/gpiolib.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,6 @@ int gpiod_get_direction(struct gpio_desc *desc)
468468
test_bit(GPIOD_FLAG_IS_OUT, &flags))
469469
return 0;
470470

471-
if (!guard.gc->get_direction)
472-
return -ENOTSUPP;
473-
474471
ret = gpiochip_get_direction(guard.gc, offset);
475472
if (ret < 0)
476473
return ret;

0 commit comments

Comments
 (0)