From: Andi Shyti <andi.shyti@kernel.org>
To: Ruan Jinjie <ruanjinjie@huawei.com>
Cc: pierre-yves.mordret@foss.st.com, alain.volmat@foss.st.com,
mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH -next] i2c: stm32: fix the return value handle for platform_get_irq()
Date: Wed, 2 Aug 2023 01:52:27 +0200 [thread overview]
Message-ID: <20230801235227.swouzgtcro4p4itv@intel.intel> (raw)
In-Reply-To: <20230801233603.iztyd2wqhcogr72r@intel.intel>
Hi Ruan,
Just a nitpick here that does not affect my r-b...
> On Mon, Jul 31, 2023 at 07:27:55PM +0800, Ruan Jinjie wrote:
> > There is no possible for platform_get_irq() to return 0,
> > and the return value of platform_get_irq() is more sensible
> > to show the error reason.
can we rephrase the whole commit to:
i2c: stm32: Do not check for 0 return after calling platform_get_irq()
It is not possible for platform_get_irq() to return 0. Use the
return value from platform_get_irq().
Two notes on the commit log:
- Use capital letter after "i2c: stm32: Fix..."
- This is not a fix, so that we shouldn't use the word "fix" in
the title.
just little notes for future patches :)
Thanks,
Andi
> > Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> > ---
> > drivers/i2c/busses/i2c-stm32f7.c | 8 ++++----
> > 1 file changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
> > index e897d9101434..579b30581725 100644
> > --- a/drivers/i2c/busses/i2c-stm32f7.c
> > +++ b/drivers/i2c/busses/i2c-stm32f7.c
> > @@ -2121,12 +2121,12 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
> > phy_addr = (dma_addr_t)res->start;
> >
> > irq_event = platform_get_irq(pdev, 0);
> > - if (irq_event <= 0)
> > - return irq_event ? : -ENOENT;
> > + if (irq_event < 0)
> > + return irq_event;
> >
> > irq_error = platform_get_irq(pdev, 1);
> > - if (irq_error <= 0)
> > - return irq_error ? : -ENOENT;
> > + if (irq_error < 0)
> > + return irq_error;
>
> Correct, from patch ce753ad1549cbe ("platform: finally disallow
> IRQ0 in platform_get_irq() and its ilk") this check is already
> done inside platform_get_irq();
>
> Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
>
> Andi
>
> >
> > i2c_dev->wakeup_src = of_property_read_bool(pdev->dev.of_node,
> > "wakeup-source");
> > --
> > 2.34.1
> >
next prev parent reply other threads:[~2023-08-01 23:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 11:27 [PATCH -next] i2c: stm32: fix the return value handle for platform_get_irq() Ruan Jinjie
2023-08-01 23:36 ` Andi Shyti
2023-08-01 23:52 ` Andi Shyti [this message]
2023-08-02 1:28 ` Ruan Jinjie
2023-08-02 9:13 ` Alain Volmat
2023-08-05 1:29 ` Andi Shyti
2023-08-05 2:44 ` Ruan Jinjie
2023-08-14 15:14 ` Wolfram Sang
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=20230801235227.swouzgtcro4p4itv@intel.intel \
--to=andi.shyti@kernel.org \
--cc=alain.volmat@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=pierre-yves.mordret@foss.st.com \
--cc=ruanjinjie@huawei.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