mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: Prashant Rahul <prashantrahul23@gmail.com>,
	Jonathan Cameron <jic23@kernel.org>,
	linux-iio@vger.kernel.org
Cc: "Shuah Khan" <shuahkhan@gmail.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Matti Vaittinen" <mazziesaccount@gmail.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Oleg Nesterov" <oleg@redhat.com>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
	"Uwe Kleine-König (The Capable Hub)"
	<u.kleine-koenig@baylibre.com>,
	"John Ogness" <john.ogness@linutronix.de>,
	"Dixit Parmar" <dixitparmar19@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: ti-adc*: use dev_err_probe for probe time errors
Date: Tue, 16 Jun 2026 09:03:35 -0500	[thread overview]
Message-ID: <f3165ebd-c359-49dc-a46a-0edacedf52d7@baylibre.com> (raw)
In-Reply-To: <20260616130612.73122-1-prashantrahul23@gmail.com>

On 6/16/26 8:05 AM, Prashant Rahul wrote:
> This simplifies error handling and ensures consistent error reporting.
> Also add missing error messages in a few probe paths where failures were
> previously returned without any diagnostics.
> 
> Signed-off-by: Prashant Rahul <prashantrahul23@gmail.com>
> ---
>  drivers/iio/adc/ti-adc081c.c    | 10 ++++------
>  drivers/iio/adc/ti-adc0832.c    |  6 +++---
>  drivers/iio/adc/ti-adc084s021.c |  3 +--
>  drivers/iio/adc/ti-adc108s102.c |  2 +-
>  drivers/iio/adc/ti-adc128s052.c |  2 +-
>  drivers/iio/adc/ti-adc161s626.c |  6 +++---
>  6 files changed, 13 insertions(+), 16 deletions(-)

Please make one patch per file.

> 
> diff --git a/drivers/iio/adc/ti-adc081c.c b/drivers/iio/adc/ti-adc081c.c
> index 33f82bdfeb94..f6ce23975b80 100644
> --- a/drivers/iio/adc/ti-adc081c.c
> +++ b/drivers/iio/adc/ti-adc081c.c
> @@ -174,26 +174,24 @@ static int adc081c_probe(struct i2c_client *client)
> 
>  	err = regulator_enable(adc->ref);
>  	if (err < 0)
> -		return err;
> +		return dev_err_probe(&client->dev, err, "failed to enable regulator\n");
> 
>  	err = devm_add_action_or_reset(&client->dev, adc081c_reg_disable,
>  				       adc->ref);
>  	if (err)
> -		return err;
> +		return dev_err_probe(&client->dev, err, "failed to register cleanup action\n");

Please don't add new error messages. If there is a really good
reason to, please do that in a separate patch with a justification
as to why it is needed.

In this particular case, the only error is -ENOMEM, which we never
have an error message for.

Above, for regulator_enable(), an error is already printed in many cases
when it fails, so needing to add an additional error message is questionable.

The same comments apply to the rest of the changes as well. Unless you actually
hit one of these errors and found it difficult to troubleshoot without an
additional message, then it probably isn't an improvement.


  reply	other threads:[~2026-06-16 14:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 13:05 Prashant Rahul
2026-06-16 14:03 ` David Lechner [this message]
2026-06-18 16:52   ` Prashant Rahul
2026-06-23 19:31     ` Jonathan Cameron
2026-06-23 19:51       ` Andy Shevchenko
     [not found] ` <20260618231543.413771-1-prashantrahul23@gmail.com>
     [not found]   ` <6b773354-6615-4cae-b7ad-d083d59133c8@baylibre.com>
2026-06-20 17:39     ` [PATCH 0/5] use dev_err_probe for probe time error Prashant Rahul
     [not found]   ` <20260618231543.413771-3-prashantrahul23@gmail.com>
     [not found]     ` <99507afa-6986-44f7-98c1-257c52a5dcd4@baylibre.com>
2026-07-03  0:35       ` [PATCH 2/5] iio: adc: ti-adc084s021: " Jonathan Cameron

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=f3165ebd-c359-49dc-a46a-0edacedf52d7@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=andy@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=dixitparmar19@gmail.com \
    --cc=jic23@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=oleg@redhat.com \
    --cc=pmladek@suse.com \
    --cc=prashantrahul23@gmail.com \
    --cc=shuahkhan@gmail.com \
    --cc=u.kleine-koenig@baylibre.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

Powered by JetHome