]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
gpio: cdev: don't report GPIOs requested as interrupts as used
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 31 Oct 2024 20:08:41 +0000 (21:08 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 4 Nov 2024 08:08:11 +0000 (09:08 +0100)
GPIOs used as shared irqs can still be requested by user-space (or
kernel drivers for that matter) yet we report them as used over the
chardev ABI. Drop the test for FLAG_USED_AS_IRQ from
gpio_desc_to_lineinfo().

Reviewed-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20241031200842.22712-1-brgl@bgdev.pl
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
drivers/gpio/gpiolib-cdev.c

index 088201de96274b2b18aac3a4c4ad87bd370ca7ad..83ebcc8c83eb0aefbc88600171b327564bf62bba 100644 (file)
@@ -2275,7 +2275,6 @@ static void gpio_desc_to_lineinfo(struct gpio_desc *desc,
         */
        if (test_bit(FLAG_REQUESTED, &dflags) ||
            test_bit(FLAG_IS_HOGGED, &dflags) ||
-           test_bit(FLAG_USED_AS_IRQ, &dflags) ||
            test_bit(FLAG_EXPORT, &dflags) ||
            test_bit(FLAG_SYSFS, &dflags) ||
            !gpiochip_line_is_valid(guard.gc, info->offset)) {