2020-03-13 03:43:24

by Chris Packham

[permalink] [raw]
Subject: [PATCH] gpio: mvebu: avoid error message for optional IRQ

platform_get_irq() will generate an error message if the requested irq
is not present

mvebu-gpio f1010140.gpio: IRQ index 3 not found

use platform_get_irq_optional() to avoid the error message being
generated.

Signed-off-by: Chris Packham <[email protected]>
---
drivers/gpio/gpio-mvebu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
index d2b999c7987f..3c9f4fb3d5a2 100644
--- a/drivers/gpio/gpio-mvebu.c
+++ b/drivers/gpio/gpio-mvebu.c
@@ -1247,7 +1247,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
* pins.
*/
for (i = 0; i < 4; i++) {
- int irq = platform_get_irq(pdev, i);
+ int irq = platform_get_irq_optional(pdev, i);

if (irq < 0)
continue;
--
2.25.1


2020-03-13 06:46:07

by Uwe Kleine-König

[permalink] [raw]
Subject: Re: [PATCH] gpio: mvebu: avoid error message for optional IRQ

Hello,

On Fri, Mar 13, 2020 at 04:42:44PM +1300, Chris Packham wrote:
> platform_get_irq() will generate an error message if the requested irq
> is not present
>
> mvebu-gpio f1010140.gpio: IRQ index 3 not found
>
> use platform_get_irq_optional() to avoid the error message being
> generated.
>
> Signed-off-by: Chris Packham <[email protected]>

LGTM

Acked-by: Uwe Kleine-K?nig <[email protected]>

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | https://www.pengutronix.de/ |

2020-03-13 15:11:14

by Bartosz Golaszewski

[permalink] [raw]
Subject: Re: [PATCH] gpio: mvebu: avoid error message for optional IRQ

pt., 13 mar 2020 o 04:42 Chris Packham
<[email protected]> napisał(a):
>
> platform_get_irq() will generate an error message if the requested irq
> is not present
>
> mvebu-gpio f1010140.gpio: IRQ index 3 not found
>
> use platform_get_irq_optional() to avoid the error message being
> generated.
>
> Signed-off-by: Chris Packham <[email protected]>
> ---
> drivers/gpio/gpio-mvebu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c
> index d2b999c7987f..3c9f4fb3d5a2 100644
> --- a/drivers/gpio/gpio-mvebu.c
> +++ b/drivers/gpio/gpio-mvebu.c
> @@ -1247,7 +1247,7 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
> * pins.
> */
> for (i = 0; i < 4; i++) {
> - int irq = platform_get_irq(pdev, i);
> + int irq = platform_get_irq_optional(pdev, i);
>
> if (irq < 0)
> continue;
> --
> 2.25.1
>

Patch applied, thanks!

Bartosz