[PATCH] gpio: shared: drop the parent check for reset-gpio devices

From: Tyler Baker

Date: Fri Nov 06 2026 - 00:29:01 EST


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@xxxxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxxx

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