mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-23 08:37:33 -04:00
i2c: sprd: Replace dev_err() with dev_err_probe() in probe function
This simplifies the code while improving log. Signed-off-by: Enrico Zanda <e.zanda1@gmail.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20250520194400.341079-9-e.zanda1@gmail.com
This commit is contained in:
@@ -469,11 +469,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;
|
||||
}
|
||||
@@ -548,13 +547,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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user