[PATCH 08/10] i2c: sprd: Replace dev_err() with dev_err_probe() in probe function

Enrico Zanda
2025-05-20T19:44:18Z

drivers/i2c/busses/i2c-sprd.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c
index 56b2e5c5fb49..9dfcb4955610 100644
--- a/drivers/i2c/busses/i2c-sprd.c
+++ b/drivers/i2c/busses/i2c-sprd.c
@@ -470,11 +470,10 @@ static int sprd_i2c_clk_init(struct sprd_i2c *i2c_dev)
i2c_dev->adap.nr, i2c_dev->src_clk);

i2c_dev->clk = devm_clk_get(i2c_dev->dev, "enable");
- if (IS_ERR(i2c_dev->clk)) {
- dev_err(i2c_dev->dev, "i2c%d can't get the enable clock\n",
- i2c_dev->adap.nr);
- return PTR_ERR(i2c_dev->clk);
- }
+ if (IS_ERR(i2c_dev->clk))
+ return dev_err_probe(i2c_dev->dev, PTR_ERR(i2c_dev->clk),
+ "i2c%d can't get the enable clock\n",
+ i2c_dev->adap.nr);

return 0;
}
@@ -549,13 +548,13 @@ static int sprd_i2c_probe(struct platform_device *pdev)
IRQF_NO_SUSPEND | IRQF_ONESHOT,
pdev->name, i2c_dev);
if (ret) {
- dev_err(&pdev->dev, "failed to request irq %d\n", i2c_dev->irq);
+ dev_err_probe(&pdev->dev, ret, "failed to request irq %d\n", i2c_dev->irq);
goto err_rpm_put;
}

ret = i2c_add_numbered_adapter(&i2c_dev->adap);
if (ret) {
- dev_err(&pdev->dev, "add adapter failed\n");
+ dev_err_probe(&pdev->dev, ret, "add adapter failed\n");
goto err_rpm_put;
}

--
2.43.0