[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfSU-xXWPmwjCKsxc_WcFdZmJuYBO1nd230SeLe7D+b-g@mail.gmail.com>
Date: Fri, 2 Jun 2023 16:03:15 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc: linus.walleij@...aro.org, brgl@...ev.pl, palmer@...belt.com,
paul.walmsley@...ive.com, linux-gpio@...r.kernel.org,
linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] gpio: sifive: Add missing check for platform_get_irq
On Fri, Jun 2, 2023 at 10:28 AM Jiasheng Jiang <jiasheng@...as.ac.cn> wrote:
>
> Add the missing check for platform_get_irq and return error code
> if it fails.
The template for function references is func().
Otherwise looks fine to me
Reviewed-by: Andy Shevchenko <andy.shevchenko@...il.com>
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
> Changelog:
>
> v1 -> v2:
>
> 1. Return "chip->irq_number[i]" instead of "-ENODEV".
> ---
> drivers/gpio/gpio-sifive.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c
> index 98939cd4a71e..7245000fb049 100644
> --- a/drivers/gpio/gpio-sifive.c
> +++ b/drivers/gpio/gpio-sifive.c
> @@ -221,8 +221,11 @@ static int sifive_gpio_probe(struct platform_device *pdev)
> return -ENODEV;
> }
>
> - for (i = 0; i < ngpio; i++)
> + for (i = 0; i < ngpio; i++) {
> chip->irq_number[i] = platform_get_irq(pdev, i);
> + if (chip->irq_number[i] < 0)
> + return chip->irq_number[i];
> + }
>
> ret = bgpio_init(&chip->gc, dev, 4,
> chip->base + SIFIVE_GPIO_INPUT_VAL,
> --
> 2.25.1
>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists