* [PATCH -next] i2c: remove redundant dev_err_probe()
@ 2023-08-01 12:45 Zhu Wang
2023-08-01 13:34 ` Conor Dooley
0 siblings, 1 reply; 2+ messages in thread
From: Zhu Wang @ 2023-08-01 12:45 UTC (permalink / raw)
To: brgl, andi.shyti, conor.dooley, daire.mcnamara, linux-arm-kernel,
linux-i2c, linux-riscv
Cc: wangzhu9
When platform_get_irq() is called, the error message has been printed,
so it need not to call dev_err_probe() to print error, and
platform_get_irq() never returned zero.
Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
---
drivers/i2c/busses/i2c-davinci.c | 2 +-
drivers/i2c/busses/i2c-microchip-corei2c.c | 5 ++---
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 52527189a7bf..329c952d5062 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -765,7 +765,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
irq = platform_get_irq(pdev, 0);
if (irq < 0)
- return dev_err_probe(&pdev->dev, irq, "can't get irq resource\n");
+ return irq;
dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
if (!dev)
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.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] i2c: remove redundant dev_err_probe()
2023-08-01 12:45 [PATCH -next] i2c: remove redundant dev_err_probe() Zhu Wang
@ 2023-08-01 13:34 ` Conor Dooley
0 siblings, 0 replies; 2+ messages in thread
From: Conor Dooley @ 2023-08-01 13:34 UTC (permalink / raw)
To: Zhu Wang
Cc: brgl, andi.shyti, conor.dooley, daire.mcnamara, linux-arm-kernel,
linux-i2c, linux-riscv
[-- Attachment #1.1: Type: text/plain, Size: 497 bytes --]
On Tue, Aug 01, 2023 at 08:45:51PM +0800, Zhu Wang wrote:
> When platform_get_irq() is called, the error message has been printed,
> so it need not to call dev_err_probe() to print error, and
> platform_get_irq() never returned zero.
Is that strictly true?
> Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
> ---
> drivers/i2c/busses/i2c-davinci.c | 2 +-
> drivers/i2c/busses/i2c-microchip-corei2c.c | 5 ++---
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-01 13:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01 12:45 [PATCH -next] i2c: remove redundant dev_err_probe() Zhu Wang
2023-08-01 13:34 ` Conor Dooley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox