From: Conor Dooley <conor.dooley@microchip.com>
To: Chen Jiahao <chenjiahao16@huawei.com>
Cc: <daire.mcnamara@microchip.com>, <broonie@kernel.org>,
<linux-riscv@lists.infradead.org>, <linux-spi@vger.kernel.org>
Subject: Re: [PATCH -next v2] spi: microchip-core: Clean up redundant dev_err_probe()
Date: Fri, 28 Jul 2023 09:05:46 +0100 [thread overview]
Message-ID: <20230728-edging-undesired-8dd77cfa0330@wendy> (raw)
In-Reply-To: <20230728075729.3451867-1-chenjiahao16@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1436 bytes --]
On Fri, Jul 28, 2023 at 03:57:29PM +0800, Chen Jiahao wrote:
> Refering to platform_get_irq()'s definition, the return value has
> already been checked if ret < 0, and printed via dev_err_probe().
> Calling dev_err_probe() one more time outside platform_get_irq()
> is obviously redundant.
>
> Furthermore, platform_get_irq() will never return irq equals 0,
> removing spi->irq == 0 checking to clean it up.
>
> Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com>
> ---
> drivers/spi/spi-microchip-core.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-microchip-core.c b/drivers/spi/spi-microchip-core.c
> index b59e8a0c5b97..b451cd4860ec 100644
> --- a/drivers/spi/spi-microchip-core.c
> +++ b/drivers/spi/spi-microchip-core.c
> @@ -530,10 +530,8 @@ static int mchp_corespi_probe(struct platform_device *pdev)
> return PTR_ERR(spi->regs);
>
> spi->irq = platform_get_irq(pdev, 0);
> - if (spi->irq <= 0)
> - return dev_err_probe(&pdev->dev, -ENXIO,
> - "invalid IRQ %d for SPI controller\n",
> - spi->irq);
> + if (spi->irq < 0)
> + return spi->irq;
Thanks for the update, looks fine to me.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
>
> ret = devm_request_irq(&pdev->dev, spi->irq, mchp_corespi_interrupt,
> IRQF_SHARED, dev_name(&pdev->dev), master);
> --
> 2.34.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-07-28 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 7:57 [PATCH -next v2] spi: microchip-core: Clean up redundant dev_err_probe() Chen Jiahao
2023-07-28 8:05 ` Conor Dooley [this message]
2023-07-28 20:05 ` Mark Brown
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=20230728-edging-undesired-8dd77cfa0330@wendy \
--to=conor.dooley@microchip.com \
--cc=broonie@kernel.org \
--cc=chenjiahao16@huawei.com \
--cc=daire.mcnamara@microchip.com \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-spi@vger.kernel.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).