* [PATCH 1/1] gpio: mxc: remove static allocation of GPIO base
@ 2023-02-14 22:46 Shenwei Wang
2023-02-15 8:29 ` Bartosz Golaszewski
0 siblings, 1 reply; 4+ messages in thread
From: Shenwei Wang @ 2023-02-14 22:46 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski; +Cc: linux-gpio, imx, Shenwei Wang
The latest gpio driver framework will give the following warning
when it detects the static allocation of the GPIO bases.
"[ 1.329312] gpio gpiochip0: Static allocation of GPIO base is
deprecated, use dynamic allocation."
This patch removes the static allocation of GPIO base to get rid
of the warning message.
Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
---
drivers/gpio/gpio-mxc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index d5626c572d24..07948175441c 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -450,8 +450,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
port->gc.request = gpiochip_generic_request;
port->gc.free = gpiochip_generic_free;
port->gc.to_irq = mxc_gpio_to_irq;
- port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
- pdev->id * 32;
err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port);
if (err)
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] gpio: mxc: remove static allocation of GPIO base
2023-02-14 22:46 [PATCH 1/1] gpio: mxc: remove static allocation of GPIO base Shenwei Wang
@ 2023-02-15 8:29 ` Bartosz Golaszewski
2023-02-15 9:29 ` Alexander Stein
2023-02-15 15:15 ` [EXT] " Shenwei Wang
0 siblings, 2 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2023-02-15 8:29 UTC (permalink / raw)
To: Shenwei Wang; +Cc: Linus Walleij, linux-gpio, imx
On Tue, Feb 14, 2023 at 11:47 PM Shenwei Wang <shenwei.wang@nxp.com> wrote:
>
> The latest gpio driver framework will give the following warning
> when it detects the static allocation of the GPIO bases.
>
> "[ 1.329312] gpio gpiochip0: Static allocation of GPIO base is
> deprecated, use dynamic allocation."
>
> This patch removes the static allocation of GPIO base to get rid
> of the warning message.
>
> Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> ---
> drivers/gpio/gpio-mxc.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
> index d5626c572d24..07948175441c 100644
> --- a/drivers/gpio/gpio-mxc.c
> +++ b/drivers/gpio/gpio-mxc.c
> @@ -450,8 +450,6 @@ static int mxc_gpio_probe(struct platform_device *pdev)
> port->gc.request = gpiochip_generic_request;
> port->gc.free = gpiochip_generic_free;
> port->gc.to_irq = mxc_gpio_to_irq;
> - port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
> - pdev->id * 32;
>
> err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port);
> if (err)
> --
> 2.34.1
>
This is one of the drivers for which we can't do it yet:
https://lore.kernel.org/linux-gpio/20230120104647.nwki4silrtd7bt3w@pengutronix.de/
Bart
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] gpio: mxc: remove static allocation of GPIO base
2023-02-15 8:29 ` Bartosz Golaszewski
@ 2023-02-15 9:29 ` Alexander Stein
2023-02-15 15:15 ` [EXT] " Shenwei Wang
1 sibling, 0 replies; 4+ messages in thread
From: Alexander Stein @ 2023-02-15 9:29 UTC (permalink / raw)
To: Shenwei Wang, Bartosz Golaszewski; +Cc: Linus Walleij, linux-gpio, imx
Hi,
Am Mittwoch, 15. Februar 2023, 09:29:36 CET schrieb Bartosz Golaszewski:
> On Tue, Feb 14, 2023 at 11:47 PM Shenwei Wang <shenwei.wang@nxp.com> wrote:
> > The latest gpio driver framework will give the following warning
> > when it detects the static allocation of the GPIO bases.
> >
> > "[ 1.329312] gpio gpiochip0: Static allocation of GPIO base is
> > deprecated, use dynamic allocation."
> >
> > This patch removes the static allocation of GPIO base to get rid
> > of the warning message.
> >
> > Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> > ---
> >
> > drivers/gpio/gpio-mxc.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
> > index d5626c572d24..07948175441c 100644
> > --- a/drivers/gpio/gpio-mxc.c
> > +++ b/drivers/gpio/gpio-mxc.c
> > @@ -450,8 +450,6 @@ static int mxc_gpio_probe(struct platform_device
> > *pdev)
> >
> > port->gc.request = gpiochip_generic_request;
> > port->gc.free = gpiochip_generic_free;
> > port->gc.to_irq = mxc_gpio_to_irq;
> >
> > - port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32
> > :
> > - pdev->id * 32;
> >
> > err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port);
> > if (err)
> >
> > --
> > 2.34.1
>
> This is one of the drivers for which we can't do it yet:
> https://lore.kernel.org/linux-gpio/20230120104647.nwki4silrtd7bt3w@pengutron
> ix.de/
I just send a patch for adding generic GPIO alias support at [1].
Having that support added this patch should apply without adding a regression.
Best regards,
Alexander
[1] https://lore.kernel.org/linux-gpio/20230215092421.143199-1-alexander.stein@ew.tq-group.com/T/#u
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [EXT] Re: [PATCH 1/1] gpio: mxc: remove static allocation of GPIO base
2023-02-15 8:29 ` Bartosz Golaszewski
2023-02-15 9:29 ` Alexander Stein
@ 2023-02-15 15:15 ` Shenwei Wang
1 sibling, 0 replies; 4+ messages in thread
From: Shenwei Wang @ 2023-02-15 15:15 UTC (permalink / raw)
To: Bartosz Golaszewski
Cc: Linus Walleij, linux-gpio@vger.kernel.org, imx@lists.linux.dev
> -----Original Message-----
> From: Bartosz Golaszewski <brgl@bgdev.pl>
> Sent: Wednesday, February 15, 2023 2:30 AM
> To: Shenwei Wang <shenwei.wang@nxp.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>; linux-gpio@vger.kernel.org;
> imx@lists.linux.dev
> Subject: [EXT] Re: [PATCH 1/1] gpio: mxc: remove static allocation of GPIO base
>
> Caution: EXT Email
>
> On Tue, Feb 14, 2023 at 11:47 PM Shenwei Wang <shenwei.wang@nxp.com>
> wrote:
> >
> > The latest gpio driver framework will give the following warning when
> > it detects the static allocation of the GPIO bases.
> >
> > "[ 1.329312] gpio gpiochip0: Static allocation of GPIO base is
> > deprecated, use dynamic allocation."
> >
> > This patch removes the static allocation of GPIO base to get rid of
> > the warning message.
> >
> > Signed-off-by: Shenwei Wang <shenwei.wang@nxp.com>
> > ---
> > drivers/gpio/gpio-mxc.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index
> > d5626c572d24..07948175441c 100644
> > --- a/drivers/gpio/gpio-mxc.c
> > +++ b/drivers/gpio/gpio-mxc.c
> > @@ -450,8 +450,6 @@ static int mxc_gpio_probe(struct platform_device
> *pdev)
> > port->gc.request = gpiochip_generic_request;
> > port->gc.free = gpiochip_generic_free;
> > port->gc.to_irq = mxc_gpio_to_irq;
> > - port->gc.base = (pdev->id < 0) ? of_alias_get_id(np, "gpio") * 32 :
> > - pdev->id * 32;
> >
> > err = devm_gpiochip_add_data(&pdev->dev, &port->gc, port);
> > if (err)
> > --
> > 2.34.1
> >
>
> This is one of the drivers for which we can't do it yet:
I would suggest to remove the alias logic inside the gpio driver. The alias feature should be
managed outside of the gpio driver and work as a separate driver to handle the alias
in one place.
Thanks,
Shenwei
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kern
> el.org%2Flinux-
> gpio%2F20230120104647.nwki4silrtd7bt3w%40pengutronix.de%2F&data=05%7
> C01%7Cshenwei.wang%40nxp.com%7C9a55c18e62dd414f6f5f08db0f2ecea4%7
> C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638120465926987476%7
> CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI
> 6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KxOAhOJ4fm1tNNc
> RLJtx4G02alhWnswQdv%2BIfkojBYU%3D&reserved=0
>
> Bart
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-15 15:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-14 22:46 [PATCH 1/1] gpio: mxc: remove static allocation of GPIO base Shenwei Wang
2023-02-15 8:29 ` Bartosz Golaszewski
2023-02-15 9:29 ` Alexander Stein
2023-02-15 15:15 ` [EXT] " Shenwei Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).