mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: shared: drop the parent check for reset-gpio devices
@ 2026-11-06  5:28 Tyler Baker
  2026-11-06 10:50 ` Bartosz Golaszewski
  0 siblings, 1 reply; 2+ messages in thread
From: Tyler Baker @ 2026-11-06  5:28 UTC (permalink / raw)
  To: Bartosz Golaszewski, Linus Walleij
  Cc: Abel Vesa, Philipp Zabel, linux-gpio, linux-kernel

gpio_shared_dev_is_reset_gpio() requires the reset-gpio device's parent
to carry the GPIO chip's fwnode. Once the reset core parents that device
to the GPIO controller instead, this fails on controllers with a
gpio_chip and fwnode per bank, so their shared reset lines are no longer
matched.

The check is redundant: only devices compatible with "reset-gpio" get
here, and their reset-gpios reference must already name the chip's
fwnode. Drop it.

Signed-off-by: Tyler Baker <tyler.baker@oss.qualcomm.com>
---
On top of Abel's "reset: gpio: Parent the reset-gpio device to the GPIO
controller":
https://lore.kernel.org/r/20261026-b4-reset-gpio-parent-to-gpio-controller-v1-1-11549e6ea930@oss.qualcomm.com

 drivers/gpio/gpiolib-shared.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c
index 8c9ac9d933049..91d91c78fe55d 100644
--- a/drivers/gpio/gpiolib-shared.c
+++ b/drivers/gpio/gpiolib-shared.c
@@ -362,22 +362,13 @@ static bool gpio_shared_dev_is_reset_gpio(struct device *consumer,
 {
 	struct fwnode_handle *reset_fwnode = dev_fwnode(consumer);
 	struct fwnode_reference_args ref_args, aux_args;
-	struct device *parent = consumer->parent;
 	struct gpio_shared_ref *real_ref;
 	bool match;
 	int ret;
 
 	lockdep_assert_held(&ref->lock);
 
-	/* The reset-gpio device must have a parent AND a firmware node. */
-	if (!parent || !reset_fwnode)
-		return false;
-
-	/*
-	 * Parent of the reset-gpio auxiliary device is the GPIO chip whose
-	 * fwnode we stored in the entry structure.
-	 */
-	if (!device_match_fwnode(parent, entry->fwnode))
+	if (!reset_fwnode)
 		return false;
 
 	/*
-- 
2.47.3


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

end of thread, other threads:[~2026-11-06 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06  5:28 [PATCH] gpio: shared: drop the parent check for reset-gpio devices Tyler Baker
2026-11-06 10:50 ` 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®