public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dipen Patel <dipenp@nvidia.com>
To: <linus.walleij@linaro.org>, <brgl@bgdev.pl>, <andy@kernel.org>,
	<thierry.reding@gmail.com>, <jonathanh@nvidia.com>,
	<linux-gpio@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: Dipen Patel <dipenp@nvidia.com>
Subject: [PATCH 1/1] gpio: tegra186: Set fwnode of the GPIO chip
Date: Mon, 9 Oct 2023 10:38:58 -0700	[thread overview]
Message-ID: <20231009173858.723686-1-dipenp@nvidia.com> (raw)

Any driver that depends on the GPIO match function to locate the GPIO
controller, it has to use the fwnode from the gpio_chip structure. But
with [1], it is GPIO providers job to set any members of the gpio_chip
structure. This patch addresses that.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/pateldipen1984/linux.git/patch/drivers/gpio/gpiolib.c?id=daecca4b8433d47f0db4933bcc0f283d530ba22e

Signed-off-by: Dipen Patel <dipenp@nvidia.com>
---
 drivers/gpio/gpio-tegra186.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
index d87dd06db40d..86ad34e07841 100644
--- a/drivers/gpio/gpio-tegra186.c
+++ b/drivers/gpio/gpio-tegra186.c
@@ -989,6 +989,12 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
 		offset += port->pins;
 	}
 
+	/*
+	 * This is needed for driver using gpio device matching where it
+	 * has to use gpio_chip fwnode to match the gpio controller.
+	 */
+	gpio->gpio.fwnode = of_node_to_fwnode(pdev->dev.of_node);
+
 	return devm_gpiochip_add_data(&pdev->dev, &gpio->gpio, gpio);
 }
 
-- 
2.25.1


             reply	other threads:[~2023-10-09 17:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 17:38 Dipen Patel [this message]
2023-10-10 13:13 ` [PATCH 1/1] gpio: tegra186: Set fwnode of the GPIO chip Andy Shevchenko
2023-10-10 13:48   ` Andy Shevchenko
2023-10-10 14:13     ` Andy Shevchenko
2023-10-10 14:25       ` Andy Shevchenko
2023-10-10 15:10         ` Bartosz Golaszewski
2023-10-10 15:18           ` Andy Shevchenko

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=20231009173858.723686-1-dipenp@nvidia.com \
    --to=dipenp@nvidia.com \
    --cc=andy@kernel.org \
    --cc=brgl@bgdev.pl \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /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