Re: [PATCH] gpio: tegra186: Support multi-socket devices

From: Bartosz Golaszewski

Date: Mon Feb 16 2026 - 13:43:58 EST


On Mon, Feb 16, 2026 at 6:22 PM Jon Hunter <jonathanh@xxxxxxxxxx> wrote:
>
>
> On 16/02/2026 11:29, Bartosz Golaszewski wrote:
> > On Mon, 16 Feb 2026 05:58:42 +0100, Prathamesh Shete <pshete@xxxxxxxxxx> said:
> >> On Tegra platforms, multiple SoC instances may be present with each
> >> defining the same GPIO name. For such devices, this results in
> >> duplicate GPIO names.
> >>
> >> When the device has a valid NUMA node, prepend the NUMA node ID
> >> to the GPIO name prefix. The node ID identifies each socket,
> >> ensuring GPIO line names remain distinct across multiple sockets.
> >>
> >> Signed-off-by: Prathamesh Shete <pshete@xxxxxxxxxx>
> >> ---
> >> drivers/gpio/gpio-tegra186.c | 26 +++++++++++++++++---------
> >> 1 file changed, 17 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
> >> index 9c874f07be75..daf5aaffa28a 100644
> >> --- a/drivers/gpio/gpio-tegra186.c
> >> +++ b/drivers/gpio/gpio-tegra186.c
> >> @@ -857,7 +857,8 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
> >> struct device_node *np;
> >> struct resource *res;
> >> char **names;
> >> - int err;
> >> + char *instance = "";
> >> + int node, err;
> >>
> >> gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
> >> if (!gpio)
> >> @@ -937,17 +938,21 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
> >> if (!names)
> >> return -ENOMEM;
> >>
> >> + node = dev_to_node(&pdev->dev);
> >> + if (node >= 0) {
> >> + instance = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL, "%d-", node);
> >
> > I've never noticed it before (and it's not introduced by this patch) but I
> > really dislike the child device registering devres nodes with its parent...
>
> While it looks a bit odd, the parent is initialised as ...
>
> gpio->gpio.parent = &pdev->dev
>

Right. Nevermind my comment then.

Bart