Linux IIO development
 help / color / mirror / Atom feed
From: Joshua Crofts <joshua.crofts1@gmail.com>
To: "Vojtěch Krátký" <vo.kratky@seznam.cz>
Cc: nuno.sa@analog.com, Michael.Hennerich@analog.com,
	jic23@kernel.org, dlechner@baylibre.com, andy@kernel.org,
	linux@analog.com, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: resolver: ad2s1200: use dev_err_probe()
Date: Thu, 16 Jul 2026 14:51:53 +0200	[thread overview]
Message-ID: <20260716145153.000003fe@gmail.com> (raw)
In-Reply-To: <20260716123100.100394-1-vo.kratky@seznam.cz>

On Thu, 16 Jul 2026 14:31:00 +0200
Vojtěch Krátký <vo.kratky@seznam.cz> wrote:

> Use dev_err_probe() instead of dev_err() to simplify the error path
> and cleanly handle deferred probing.
> 
> Signed-off-by: Vojtěch Krátký <vo.kratky@seznam.cz>
> ---
>  drivers/iio/resolver/ad2s1200.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/resolver/ad2s1200.c b/drivers/iio/resolver/ad2s1200.c
> index 55bcbbd4021a..7c7ce0e2f9cc 100644
> --- a/drivers/iio/resolver/ad2s1200.c
> +++ b/drivers/iio/resolver/ad2s1200.c
> @@ -144,16 +144,14 @@ static int ad2s1200_probe(struct spi_device *spi)
>  
>  	st->sample = devm_gpiod_get(&spi->dev, "adi,sample", GPIOD_OUT_LOW);
>  	if (IS_ERR(st->sample)) {
> -		dev_err(&spi->dev, "Failed to claim SAMPLE gpio: err=%ld\n",
> -			PTR_ERR(st->sample));
> -		return PTR_ERR(st->sample);
> +		return dev_err_probe(&spi->dev, PTR_ERR(st->sample),
> +				"Failed to claim SAMPLE gpio\n");

Please align the error message with the parenthesis, i.e.

> +		return dev_err_probe(&spi->dev, PTR_ERR(st->sample),
> +				     "Failed to claim SAMPLE gpio\n");

Same goes for the other change in this patch.

-- 
Kind regards

CJD

  parent reply	other threads:[~2026-07-16 12:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 12:31 [PATCH] iio: resolver: ad2s1200: use dev_err_probe() Vojtěch Krátký
2026-07-16 12:46 ` Markus Elfring
2026-07-16 12:51 ` Joshua Crofts [this message]
2026-07-16 17:38 ` Andy Shevchenko

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=20260716145153.000003fe@gmail.com \
    --to=joshua.crofts1@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=vo.kratky@seznam.cz \
    /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