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: e623c4303e ("gpiolib: sanitize the return value of gpio_chip::get_direction()")
Reported-by: Michael Walle <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Bartosz Golaszewski <[email protected]>
This commit is contained in:
Bartosz Golaszewski committed 2026-01-12 09:35:04 +01:00
1 parent c187900187
commit 471e998c0e
1 file changed
-3
-3
View File
@@ -468,9 +468,6 @@ int gpiod_get_direction(struct gpio_desc *desc)
test_bit(GPIOD_FLAG_IS_OUT, &flags))
return 0;
if (!guard.gc->get_direction)
return -ENOTSUPP;
ret = gpiochip_get_direction(guard.gc, offset);
if (ret < 0)
return ret;