mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] gpiolib: use of_node_name if line-name is missing
@ 2026-09-17 15:37 Frank Wunderlich
  2026-09-18  6:26 ` Andy Shevchenko
  2026-09-18  7:59 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Frank Wunderlich @ 2026-09-17 15:37 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko, Bartosz Golaszewski
  Cc: Frank Wunderlich, Mika Westerberg, linux-gpio, linux-kernel,
	frank.wunderlich

From: Frank Wunderlich <frank-w@public-files.de>

Until v7.0, GPIO hogs inherited the DT node name when no line-name
property was specified. This was implemented as a fallback in
of_parse_own_gpio().

Commit d1d564ec4992 ("gpio: move hogs into GPIO core") moved hog parsing
into the GPIO core and removed this fallback.

Consequently, GPIO hogs without a line-name property are now displayed
with a ? in /sys/kernel/debug/gpio. Restore the old fallback.

Fixes: d1d564ec4992 ("gpio: move hogs into GPIO core")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
v2:
- move code into loop as suggested by Andy and add comment about the reason
---
 drivers/gpio/gpiolib.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index ef8ccaf17c9c..28f7265c5d56 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1029,6 +1029,13 @@ int gpiochip_add_hog(struct gpio_chip *gc, struct fwnode_handle *fwnode)
 			ret = of_gpiochip_get_lflags(gc, &gpiospec, &lflags);
 			if (ret)
 				return ret;
+
+			/*
+			 * If no line-name property is present, fall back to the OF
+			 * node name as in the previous implementation.
+			 */
+			if (!name)
+				name = to_of_node(fwnode)->name;
 		} else {
 			/*
 			 * GPIO_ACTIVE_LOW is currently the only lookup flag
-- 
2.53.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] gpiolib: use of_node_name if line-name is missing
  2026-09-17 15:37 [PATCH v2] gpiolib: use of_node_name if line-name is missing Frank Wunderlich
@ 2026-09-18  6:26 ` Andy Shevchenko
  2026-09-18  7:59 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-09-18  6:26 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Linus Walleij, Bartosz Golaszewski, Frank Wunderlich,
	Mika Westerberg, linux-gpio, linux-kernel, frank.wunderlich

On Thu, Sep 17, 2026 at 05:37:11PM +0200, Frank Wunderlich wrote:

> Until v7.0, GPIO hogs inherited the DT node name when no line-name
> property was specified. This was implemented as a fallback in
> of_parse_own_gpio().
> 
> Commit d1d564ec4992 ("gpio: move hogs into GPIO core") moved hog parsing
> into the GPIO core and removed this fallback.
> 
> Consequently, GPIO hogs without a line-name property are now displayed
> with a ? in /sys/kernel/debug/gpio. Restore the old fallback.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] gpiolib: use of_node_name if line-name is missing
  2026-09-17 15:37 [PATCH v2] gpiolib: use of_node_name if line-name is missing Frank Wunderlich
  2026-09-18  6:26 ` Andy Shevchenko
@ 2026-09-18  7:59 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2026-09-18  7:59 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko, Bartosz Golaszewski, Frank Wunderlich
  Cc: Bartosz Golaszewski, Frank Wunderlich, Mika Westerberg,
	linux-gpio, linux-kernel, frank.wunderlich


On Thu, 17 Sep 2026 17:37:11 +0200, Frank Wunderlich wrote:
> Until v7.0, GPIO hogs inherited the DT node name when no line-name
> property was specified. This was implemented as a fallback in
> of_parse_own_gpio().
> 
> Commit d1d564ec4992 ("gpio: move hogs into GPIO core") moved hog parsing
> into the GPIO core and removed this fallback.
> 
> [...]

Applied, thanks!

[1/1] gpiolib: use of_node_name if line-name is missing
      https://git.kernel.org/brgl/c/d54a489c8c4b627775445d54a6cbd32f209bda8f

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-18  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 15:37 [PATCH v2] gpiolib: use of_node_name if line-name is missing Frank Wunderlich
2026-09-18  6:26 ` Andy Shevchenko
2026-09-18  7:59 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®