diff options
author | Zhu Wang <wangzhu9@huawei.com> | 2023-08-01 16:48:14 +0300 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2023-08-08 16:36:55 +0300 |
commit | adcf6eae6d21f480c6d4d691e8dfa5a5223d71c6 (patch) | |
tree | 354a624f9f5e8644cf0a06fbaf2991afad31a1ca /drivers/i2c/busses | |
parent | f5d5bc5fda5cfc127d258166e5d6d91cf17efd48 (diff) | |
download | linux-adcf6eae6d21f480c6d4d691e8dfa5a5223d71c6.tar.xz |
i2c: remove redundant dev_err_probe()
When platform_get_irq() is called, the error message has been printed,
so it need not to call dev_err_probe() to print error.
As the comment of platform_get_irq() says, it returned non-zero value
when it succeeded, and it returned negative value when it failed.
Signed-off-by: Zhu Wang <wangzhu9@huawei.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20230801134814.247782-1-wangzhu9@huawei.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-davinci.c | 2 | ||||
-rw-r--r-- | 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)) |