From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Shenwei Wang <shenwei.wang@nxp.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Stephen Boyd <swboyd@chromium.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"imx@lists.linux.dev" <imx@lists.linux.dev>,
dl-linux-imx <linux-imx@nxp.com>,
Fugang Duan <fugang.duan@nxp.com>
Subject: Re: [EXT] Re: [PATCH 1/1] gpio: mxc: use platform_get_irq_optional() to avoid error message
Date: Tue, 9 May 2023 18:41:38 +0300 [thread overview]
Message-ID: <CAHp75VfpgSaNvnZwVYD-vXX0G7eeWimxrqKGyNReB7t2ZQ6h_g@mail.gmail.com> (raw)
In-Reply-To: <PAXPR04MB9185BFE399C00B2BEB3184C589769@PAXPR04MB9185.eurprd04.prod.outlook.com>
On Tue, May 9, 2023 at 6:31 PM Shenwei Wang <shenwei.wang@nxp.com> wrote:
> > From: Andy Shevchenko <andy.shevchenko@gmail.com>
> > Sent: Tuesday, May 9, 2023 4:12 AM
> > On Mon, May 8, 2023 at 10:46 PM Shenwei Wang <shenwei.wang@nxp.com>
> > wrote:
...
> > > if (irq_count > 1) {
> > > - port->irq_high = platform_get_irq(pdev, 1);
> > > + port->irq_high = platform_get_irq_optional(pdev, 1);
> > > if (port->irq_high < 0)
> > > port->irq_high = 0;
> >
> > I would rather do
> >
> > err = platform_get_irq_optional(pdev, 1);
> > if (err >= 0)
>
> Should be "if (err > 0)", right? As the platform_get_irq_optional() return non-zero
> IRQ number on success.
Either way will work, but your proposal is better.
> > port->irq_high = err;
> >
> > > }
> >
> > And looking into the code the above piece makes more sense after asking for
> > the first (mandatory) IRQ.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2023-05-09 15:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 19:45 [PATCH 1/1] gpio: mxc: use platform_get_irq_optional() to avoid error message Shenwei Wang
2023-05-09 9:11 ` Andy Shevchenko
2023-05-09 15:31 ` [EXT] " Shenwei Wang
2023-05-09 15:41 ` Andy Shevchenko [this message]
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=CAHp75VfpgSaNvnZwVYD-vXX0G7eeWimxrqKGyNReB7t2ZQ6h_g@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=brgl@bgdev.pl \
--cc=fugang.duan@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=rafael.j.wysocki@intel.com \
--cc=shenwei.wang@nxp.com \
--cc=swboyd@chromium.org \
/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).