mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: ath79: convert to dynamic GPIO base allocation
@ 2024-06-25  1:06 Shiji Yang
  2024-06-25 14:16 ` Jonas Gorski
  0 siblings, 1 reply; 3+ messages in thread
From: Shiji Yang @ 2024-06-25  1:06 UTC (permalink / raw)
  To: linux-gpio
  Cc: Alban Bedel, Linus Walleij, Bartosz Golaszewski, linux-kernel,
	Shiji Yang

ath79 target has already been converted to device tree based
platform. Using dynamic GPIO numberspace base to suppress the
warning:

gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.

Tested on Atheros AR7241 and AR9344.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
 drivers/gpio/gpio-ath79.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
index f0c0c0f77eb0..d986424a661e 100644
--- a/drivers/gpio/gpio-ath79.c
+++ b/drivers/gpio/gpio-ath79.c
@@ -273,8 +273,8 @@ static int ath79_gpio_probe(struct platform_device *pdev)
 		dev_err(dev, "bgpio_init failed\n");
 		return err;
 	}
-	/* Use base 0 to stay compatible with legacy platforms */
-	ctrl->gc.base = 0;
+	/* Dynamic allocation */
+	ctrl->gc.base = -1;
 
 	/* Optional interrupt setup */
 	if (!np || of_property_read_bool(np, "interrupt-controller")) {
-- 
2.45.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: ath79: convert to dynamic GPIO base allocation
  2024-06-25  1:06 [PATCH] gpio: ath79: convert to dynamic GPIO base allocation Shiji Yang
@ 2024-06-25 14:16 ` Jonas Gorski
  2024-06-26  0:42   ` Shiji Yang
  0 siblings, 1 reply; 3+ messages in thread
From: Jonas Gorski @ 2024-06-25 14:16 UTC (permalink / raw)
  To: Shiji Yang
  Cc: linux-gpio, Alban Bedel, Linus Walleij, Bartosz Golaszewski,
	linux-kernel

Hi,

On Tue, 25 Jun 2024 at 03:09, Shiji Yang <yangshiji66@outlook.com> wrote:
>
> ath79 target has already been converted to device tree based
> platform. Using dynamic GPIO numberspace base to suppress the
> warning:
>
> gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
>
> Tested on Atheros AR7241 and AR9344.
>
> Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
> ---
>  drivers/gpio/gpio-ath79.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c
> index f0c0c0f77eb0..d986424a661e 100644
> --- a/drivers/gpio/gpio-ath79.c
> +++ b/drivers/gpio/gpio-ath79.c
> @@ -273,8 +273,8 @@ static int ath79_gpio_probe(struct platform_device *pdev)
>                 dev_err(dev, "bgpio_init failed\n");
>                 return err;
>         }
> -       /* Use base 0 to stay compatible with legacy platforms */
> -       ctrl->gc.base = 0;
> +       /* Dynamic allocation */
> +       ctrl->gc.base = -1;

bgpip_init() will already have set gc.base to -1, so you can just drop
the assignment.

Best Regards,
Jonas

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: ath79: convert to dynamic GPIO base allocation
  2024-06-25 14:16 ` Jonas Gorski
@ 2024-06-26  0:42   ` Shiji Yang
  0 siblings, 0 replies; 3+ messages in thread
From: Shiji Yang @ 2024-06-26  0:42 UTC (permalink / raw)
  To: jonas.gorski; +Cc: albeu, brgl, linus.walleij, linux-gpio, linux-kernel

On 2024-06-25 14:16 UTC, Jonas Gorski wrote:
>
>> -       /* Use base 0 to stay compatible with legacy platforms */
>> -       ctrl->gc.base = 0;
>> +       /* Dynamic allocation */
>> +       ctrl->gc.base = -1;
>
>bgpip_init() will already have set gc.base to -1, so you can just drop
>the assignment.
>
>Best Regards,
>Jonas
>

Thanks, I've updated it in v2 patch:
https://lore.kernel.org/linux-gpio/TYCP286MB089598EA71E964BD8AB9EFD3BCD62@TYCP286MB0895.JPNP286.PROD.OUTLOOK.COM/

Regards,
Shiji Yang

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-26  0:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-25  1:06 [PATCH] gpio: ath79: convert to dynamic GPIO base allocation Shiji Yang
2024-06-25 14:16 ` Jonas Gorski
2024-06-26  0:42   ` Shiji Yang

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®