* [PATCH -next] i2c: microchip-corei2c: clean up redundant dev_err_probe()
@ 2023-07-28 8:31 Chen Jiahao
2023-07-28 8:44 ` Conor Dooley
0 siblings, 1 reply; 2+ messages in thread
From: Chen Jiahao @ 2023-07-28 8:31 UTC (permalink / raw)
To: conor.dooley, daire.mcnamara, andi.shyti, linux-riscv, linux-i2c
Cc: chenjiahao16
Referring to platform_get_irq()'s definition, the return value has
already been checked, error message also been printed via
dev_err_probe() if ret < 0. 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/i2c/busses/i2c-microchip-corei2c.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-microchip-corei2c.c b/drivers/i2c/busses/i2c-microchip-corei2c.c
index 7f58f7eaabb6..0b0a1c4d17ca 100644
--- a/drivers/i2c/busses/i2c-microchip-corei2c.c
+++ b/drivers/i2c/busses/i2c-microchip-corei2c.c
@@ -378,9 +378,8 @@ static int mchp_corei2c_probe(struct platform_device *pdev)
return PTR_ERR(idev->base);
irq = platform_get_irq(pdev, 0);
- if (irq <= 0)
- return dev_err_probe(&pdev->dev, -ENXIO,
- "invalid IRQ %d for I2C controller\n", irq);
+ if (irq < 0)
+ return irq;
idev->i2c_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(idev->i2c_clk))
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] i2c: microchip-corei2c: clean up redundant dev_err_probe()
2023-07-28 8:31 [PATCH -next] i2c: microchip-corei2c: clean up redundant dev_err_probe() Chen Jiahao
@ 2023-07-28 8:44 ` Conor Dooley
0 siblings, 0 replies; 2+ messages in thread
From: Conor Dooley @ 2023-07-28 8:44 UTC (permalink / raw)
To: Chen Jiahao; +Cc: daire.mcnamara, andi.shyti, linux-riscv, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 575 bytes --]
On Fri, Jul 28, 2023 at 04:31:37PM +0800, Chen Jiahao wrote:
> Referring to platform_get_irq()'s definition, the return value has
> already been checked, error message also been printed via
> dev_err_probe() if ret < 0. 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>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-28 8:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-28 8:31 [PATCH -next] i2c: microchip-corei2c: clean up redundant dev_err_probe() Chen Jiahao
2023-07-28 8:44 ` Conor Dooley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox