public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Atharv Dubey <atharvd440@gmail.com>,
	Till Harbaum <till@harbaum.org>,
	Andi Shyti <andi.shyti@kernel.org>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	Dmitry Osipenko <digetx@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>,
	Alain Volmat <alain.volmat@foss.st.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Orson Zhai <orsonzhai@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Jean Delvare <jdelvare@suse.com>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-tegra@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev,
	linux-stm32@st-md-mailman.stormreply.com,
	Enrico Zanda <e.zanda1@gmail.com>
Subject: Re: [PATCH 02/10] i2c: tegra: Replace dev_err() with dev_err_probe() in probe function
Date: Tue, 24 Mar 2026 21:04:37 +0000	[thread overview]
Message-ID: <0debe6f9-581c-4093-ae4a-9025bf1a7760@nvidia.com> (raw)
In-Reply-To: <20260324-deverr-v1-2-7e591cce33a3@gmail.com>



On 24/03/2026 18:26, Atharv Dubey wrote:
> From: Enrico Zanda <e.zanda1@gmail.com>
> 
> This simplifies the code while improving log.
> 
> Signed-off-by: Enrico Zanda <e.zanda1@gmail.com>
> Signed-off-by: Atharv Dubey <atharvd440@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 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");

So this will never be a probe defer, so why bother?

>   		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");

This is not right.

>   		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");

We have already got the clock and so I don't think that this is needed 
either.

>   		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");

I don't think that this is needed either.

>   	else
>   		ret = tegra_i2c_init(i2c_dev);
>   
> 

-- 
nvpublic


  reply	other threads:[~2026-03-24 21:06 UTC|newest]

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

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=0debe6f9-581c-4093-ae4a-9025bf1a7760@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andi.shyti@kernel.org \
    --cc=atharvd440@gmail.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=digetx@gmail.com \
    --cc=e.zanda1@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=orsonzhai@gmail.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=pierre-yves.mordret@foss.st.com \
    --cc=samuel@sholland.org \
    --cc=thierry.reding@gmail.com \
    --cc=till@harbaum.org \
    --cc=wens@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /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