From: Alain Volmat <alain.volmat@foss.st.com>
To: Ruan Jinjie <ruanjinjie@huawei.com>
Cc: <pierre-yves.mordret@foss.st.com>, <andi.shyti@kernel.org>,
<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 11:13:30 +0200 [thread overview]
Message-ID: <20230802091330.GA2156918@gnbcxd0016.gnb.st.com> (raw)
In-Reply-To: <20230731112755.1943630-1-ruanjinjie@huawei.com>
Hi Ruan,
thanks for your patch.
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.
>
> 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;
>
> i2c_dev->wakeup_src = of_property_read_bool(pdev->dev.of_node,
> "wakeup-source");
Acked-by: Alain Volmat <alain.volmat@foss.st.com>
Regards
Alain
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-08-02 9:14 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
2023-08-02 1:28 ` Ruan Jinjie
2023-08-02 9:13 ` Alain Volmat [this message]
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=20230802091330.GA2156918@gnbcxd0016.gnb.st.com \
--to=alain.volmat@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andi.shyti@kernel.org \
--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