]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gpiolib: don't use GPIO global numbers in debugfs output
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Mon, 7 Jul 2025 14:13:13 +0000 (16:13 +0200)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Sun, 13 Jul 2025 08:43:55 +0000 (10:43 +0200)
One of the users of global GPIO numbers in the kernel are the debugfs
callbacks in GPIO drivers. Before converting any custom .dbg_show()
callbacks in individual modules, let's first make GPIO core stop using
GPIO base in debugfs output. Use hardware offsets instead.

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

index 7b2174b10219964a3f106562e1685a6d900d56c8..62694ec12a0cdf0f41895f126e298908e0d3e2bc 100644 (file)
@@ -5234,8 +5234,8 @@ core_initcall(gpiolib_dev_init);
 static void gpiolib_dbg_show(struct seq_file *s, struct gpio_device *gdev)
 {
        bool active_low, is_irq, is_out;
-       unsigned int gpio = gdev->base;
        struct gpio_desc *desc;
+       unsigned int gpio = 0;
        struct gpio_chip *gc;
        unsigned long flags;
        int value;
@@ -5339,8 +5339,7 @@ static int gpiolib_seq_show(struct seq_file *s, void *v)
                return 0;
        }
 
-       seq_printf(s, "%s: GPIOs %u-%u", dev_name(&gdev->dev), gdev->base,
-                  gdev->base + gdev->ngpio - 1);
+       seq_printf(s, "%s: %u GPIOs", dev_name(&gdev->dev), gdev->ngpio);
        parent = gc->parent;
        if (parent)
                seq_printf(s, ", parent: %s/%s",