public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Enrico Zanda <e.zanda1@gmail.com>
To: linux-i2c@vger.kernel.org
Cc: andi.shyti@kernel.org, Enrico Zanda <e.zanda1@gmail.com>
Subject: [PATCH 02/10] i2c: tegra: Replace dev_err() with dev_err_probe() in probe function
Date: Tue, 20 May 2025 21:43:52 +0200	[thread overview]
Message-ID: <20250520194400.341079-3-e.zanda1@gmail.com> (raw)
In-Reply-To: <20250520194400.341079-1-e.zanda1@gmail.com>

This simplifies the code while improving log.

Signed-off-by: Enrico Zanda <e.zanda1@gmail.com>
---
 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 049b4d154c23..0cfa45da9b94 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -471,8 +471,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;
 	}
 
@@ -484,8 +484,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;
 	}
 
@@ -1710,7 +1710,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;
 	}
 
@@ -1736,7 +1736,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


  parent reply	other threads:[~2025-05-20 19:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20 19:43 [PATCH 00/10] i2c: Replace dev_err() with dev_err_probe() Enrico Zanda
2025-05-20 19:43 ` [PATCH 01/10] i2c: tiny-usb: Replace dev_err() with dev_err_probe() in probe function Enrico Zanda
2025-05-20 19:43 ` Enrico Zanda [this message]
2025-05-20 19:43 ` [PATCH 03/10] i2c: sun6i-p2wi: " Enrico Zanda
2025-05-20 19:43 ` [PATCH 04/10] i2c: stm32f7: " Enrico Zanda
2025-05-20 19:43 ` [PATCH 05/10] i2c: stm32f4: " Enrico Zanda
2025-05-20 19:43 ` [PATCH 06/10] i2c: stm32: " Enrico Zanda
2025-05-20 19:43 ` [PATCH 07/10] i2c: st: " Enrico Zanda
2025-05-20 19:43 ` [PATCH 08/10] i2c: sprd: " Enrico Zanda
2025-05-20 19:43 ` [PATCH 09/10] i2c: sis96x: " Enrico Zanda
2025-05-20 19:44 ` [PATCH 10/10] i2c: sis630: " Enrico Zanda
  -- strict thread matches above, loose matches on Subject: below --
2026-03-24 18:26 [PATCH 00/10] i2c: Replace dev_err() with dev_err_probe() Atharv Dubey
2026-03-24 18:26 ` [PATCH 02/10] i2c: tegra: Replace dev_err() with dev_err_probe() in probe function Atharv Dubey
2026-03-24 21:04   ` Jon Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250520194400.341079-3-e.zanda1@gmail.com \
    --to=e.zanda1@gmail.com \
    --cc=andi.shyti@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox