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

Atharv Dubey
2026-03-24T18:27:32Z

drivers/i2c/busses/i2c-tegra.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index bec619b9af4e..51d15fca82fc 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -575,8 +575,8 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
dma_buf = dma_alloc_coherent(i2c_dev->dma_dev, i2c_dev->dma_buf_size,
&dma_phys, GFP_KERNEL | __GFP_NOWARN);
if (!dma_buf) {
- dev_err(i2c_dev->dev, "failed to allocate DMA buffer\n");
- err = -ENOMEM;
+ err = dev_err_probe(i2c_dev->dev, -ENOMEM,
+ "failed to allocate DMA buffer\n");
goto err_out;
}

@@ -588,8 +588,8 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
err_out:
tegra_i2c_release_dma(i2c_dev);
if (err != -EPROBE_DEFER) {
- dev_err(i2c_dev->dev, "cannot use DMA: %d\n", err);
- dev_err(i2c_dev->dev, "falling back to PIO\n");
+ dev_err_probe(i2c_dev->dev, err,
+ "cannot use DMA, falling back to PIO\n");
return 0;
}

@@ -1953,7 +1953,7 @@ static int tegra_i2c_init_clocks(struct tegra_i2c_dev *i2c_dev)

err = clk_enable(i2c_dev->div_clk);
if (err) {
- dev_err(i2c_dev->dev, "failed to enable div-clk: %d\n", err);
+ dev_err_probe(i2c_dev->dev, err, "failed to enable div-clk\n");
goto unprepare_clocks;
}

@@ -1979,7 +1979,7 @@ static int tegra_i2c_init_hardware(struct tegra_i2c_dev *i2c_dev)

ret = pm_runtime_get_sync(i2c_dev->dev);
if (ret < 0)
- dev_err(i2c_dev->dev, "runtime resume failed: %d\n", ret);
+ dev_err_probe(i2c_dev->dev, ret, "runtime resume failed\n");
else
ret = tegra_i2c_init(i2c_dev);

--
2.43.0