linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: pxa: Avoid a warning when gpio0 and gpio1 IRQS are not there
@ 2020-01-28 21:08 Lubomir Rintel
  2020-02-04 10:13 ` Bartosz Golaszewski
  0 siblings, 1 reply; 3+ messages in thread
From: Lubomir Rintel @ 2020-01-28 21:08 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Linus Walleij, Bartosz Golaszewski, linux-gpio, linux-kernel,
	Lubomir Rintel

Not all platforms use those. Let's use
platform_get_irq_byname_optional() instead platform_get_irq_byname() so
that we avoid a useless warning:

  [    1.359455] pxa-gpio d4019000.gpio: IRQ gpio0 not found
  [    1.359583] pxa-gpio d4019000.gpio: IRQ gpio1 not found

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
 drivers/gpio/gpio-pxa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index 9888b62f37afb..567742d962aef 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -652,8 +652,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
 	if (!pchip->irqdomain)
 		return -ENOMEM;
 
-	irq0 = platform_get_irq_byname(pdev, "gpio0");
-	irq1 = platform_get_irq_byname(pdev, "gpio1");
+	irq0 = platform_get_irq_byname_optional(pdev, "gpio0");
+	irq1 = platform_get_irq_byname_optional(pdev, "gpio1");
 	irq_mux = platform_get_irq_byname(pdev, "gpio_mux");
 	if ((irq0 > 0 && irq1 <= 0) || (irq0 <= 0 && irq1 > 0)
 		|| (irq_mux <= 0))
-- 
2.24.1


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

* Re: [PATCH] gpio: pxa: Avoid a warning when gpio0 and gpio1 IRQS are not there
  2020-01-28 21:08 [PATCH] gpio: pxa: Avoid a warning when gpio0 and gpio1 IRQS are not there Lubomir Rintel
@ 2020-02-04 10:13 ` Bartosz Golaszewski
  2020-02-05 17:57   ` Robert Jarzmik
  0 siblings, 1 reply; 3+ messages in thread
From: Bartosz Golaszewski @ 2020-02-04 10:13 UTC (permalink / raw)
  To: Lubomir Rintel; +Cc: Robert Jarzmik, Linus Walleij, linux-gpio, LKML

wt., 28 sty 2020 o 22:08 Lubomir Rintel <lkundrak@v3.sk> napisał(a):
>
> Not all platforms use those. Let's use
> platform_get_irq_byname_optional() instead platform_get_irq_byname() so
> that we avoid a useless warning:
>
>   [    1.359455] pxa-gpio d4019000.gpio: IRQ gpio0 not found
>   [    1.359583] pxa-gpio d4019000.gpio: IRQ gpio1 not found
>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> ---
>  drivers/gpio/gpio-pxa.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
> index 9888b62f37afb..567742d962aef 100644
> --- a/drivers/gpio/gpio-pxa.c
> +++ b/drivers/gpio/gpio-pxa.c
> @@ -652,8 +652,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
>         if (!pchip->irqdomain)
>                 return -ENOMEM;
>
> -       irq0 = platform_get_irq_byname(pdev, "gpio0");
> -       irq1 = platform_get_irq_byname(pdev, "gpio1");
> +       irq0 = platform_get_irq_byname_optional(pdev, "gpio0");
> +       irq1 = platform_get_irq_byname_optional(pdev, "gpio1");
>         irq_mux = platform_get_irq_byname(pdev, "gpio_mux");
>         if ((irq0 > 0 && irq1 <= 0) || (irq0 <= 0 && irq1 > 0)
>                 || (irq_mux <= 0))
> --
> 2.24.1
>

Patch applied. Thanks!

Bartosz

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

* Re: [PATCH] gpio: pxa: Avoid a warning when gpio0 and gpio1 IRQS are not there
  2020-02-04 10:13 ` Bartosz Golaszewski
@ 2020-02-05 17:57   ` Robert Jarzmik
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Jarzmik @ 2020-02-05 17:57 UTC (permalink / raw)
  To: Lubomir Rintel, Bartosz Golaszewski; +Cc: Linus Walleij, linux-gpio, LKML

Bartosz Golaszewski <bgolaszewski@baylibre.com> writes:

> wt., 28 sty 2020 o 22:08 Lubomir Rintel <lkundrak@v3.sk> napisał(a):
>>
>> Not all platforms use those. Let's use
>> platform_get_irq_byname_optional() instead platform_get_irq_byname() so
>> that we avoid a useless warning:
>>
>>   [    1.359455] pxa-gpio d4019000.gpio: IRQ gpio0 not found
>>   [    1.359583] pxa-gpio d4019000.gpio: IRQ gpio1 not found
>>
>> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Okay, what would have really be nice in the commit message was to state _which_
platform doesn't use these, and still use pxa-gpio as their gpio driver.

Cheers.

--
Robert

PS: And yes, my response is late, but I'm moving house so my ping is huge
lately.

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

end of thread, other threads:[~2020-02-05 17:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28 21:08 [PATCH] gpio: pxa: Avoid a warning when gpio0 and gpio1 IRQS are not there Lubomir Rintel
2020-02-04 10:13 ` Bartosz Golaszewski
2020-02-05 17:57   ` Robert Jarzmik

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).