linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Cc: linus.walleij@linaro.org, brgl@bgdev.pl, palmer@dabbelt.com,
	 paul.walmsley@sifive.com, linux-gpio@vger.kernel.org,
	 linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] gpio: sifive: Add missing check for platform_get_irq
Date: Fri, 2 Jun 2023 16:03:15 +0300	[thread overview]
Message-ID: <CAHp75VfSU-xXWPmwjCKsxc_WcFdZmJuYBO1nd230SeLe7D+b-g@mail.gmail.com> (raw)
In-Reply-To: <20230602072755.7314-1-jiasheng@iscas.ac.cn>

On Fri, Jun 2, 2023 at 10:28 AM Jiasheng Jiang <jiasheng@iscas.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@gmail.com>

> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.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

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  reply	other threads:[~2023-06-02 13:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02  7:27 [PATCH v2] gpio: sifive: Add missing check for platform_get_irq Jiasheng Jiang
2023-06-02 13:03 ` Andy Shevchenko [this message]
2023-06-03 17:47 ` kernel test robot
2023-06-03 20:59   ` Andy Shevchenko
2023-06-05  1:17 Jiasheng Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75VfSU-xXWPmwjCKsxc_WcFdZmJuYBO1nd230SeLe7D+b-g@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).