mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tyler Baker <tyler.baker@oss.qualcomm.com>
To: Bartosz Golaszewski <brgl@kernel.org>, Linus Walleij <linusw@kernel.org>
Cc: Abel Vesa <abel.vesa@oss.qualcomm.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] gpio: shared: drop the parent check for reset-gpio devices
Date: Fri,  6 Nov 2026 00:28:50 -0500	[thread overview]
Message-ID: <20261106052851.2741296-1-tyler.baker@oss.qualcomm.com> (raw)

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


                 reply	other threads:[~2026-11-06  5:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261106052851.2741296-1-tyler.baker@oss.qualcomm.com \
    --to=tyler.baker@oss.qualcomm.com \
    --cc=abel.vesa@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®