* [PATCH] gpiolib: don't use GPIO global numbers in debugfs output
@ 2025-07-07 14:13 Bartosz Golaszewski
2025-07-11 18:10 ` Linus Walleij
2025-07-13 8:44 ` Bartosz Golaszewski
0 siblings, 2 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-07-07 14:13 UTC (permalink / raw)
To: Linus Walleij; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
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.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/gpio/gpiolib.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 7b2174b10219..62694ec12a0c 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -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",
--
2.48.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] gpiolib: don't use GPIO global numbers in debugfs output
2025-07-07 14:13 [PATCH] gpiolib: don't use GPIO global numbers in debugfs output Bartosz Golaszewski
@ 2025-07-11 18:10 ` Linus Walleij
2025-07-13 8:44 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2025-07-11 18:10 UTC (permalink / raw)
To: Bartosz Golaszewski; +Cc: linux-gpio, linux-kernel, Bartosz Golaszewski
On Mon, Jul 7, 2025 at 4:13 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> 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.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpiolib: don't use GPIO global numbers in debugfs output
2025-07-07 14:13 [PATCH] gpiolib: don't use GPIO global numbers in debugfs output Bartosz Golaszewski
2025-07-11 18:10 ` Linus Walleij
@ 2025-07-13 8:44 ` Bartosz Golaszewski
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-07-13 8:44 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: Bartosz Golaszewski, linux-gpio, linux-kernel
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Mon, 07 Jul 2025 16:13:13 +0200, Bartosz Golaszewski wrote:
> 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.
>
>
Applied, thanks!
[1/1] gpiolib: don't use GPIO global numbers in debugfs output
https://git.kernel.org/brgl/linux/c/1bec20dfa3d81be716e7ff5a6343bdec1d29b828
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-13 8:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 14:13 [PATCH] gpiolib: don't use GPIO global numbers in debugfs output Bartosz Golaszewski
2025-07-11 18:10 ` Linus Walleij
2025-07-13 8:44 ` Bartosz Golaszewski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.