* [PATCH v2] iio: resolver: ad2s1200: use dev_err_probe()
@ 2026-07-16 17:03 Vojtěch Krátký
2026-07-16 18:20 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Vojtěch Krátký @ 2026-07-16 17:03 UTC (permalink / raw)
To: nuno.sa, Michael.Hennerich, jic23
Cc: dlechner, andy, linux, linux-iio, linux-kernel, vo.kratky
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>
---
Changes in v2:
- Removed curly brackets
- aligned the error message with the parenthesis
drivers/iio/resolver/ad2s1200.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/drivers/iio/resolver/ad2s1200.c b/drivers/iio/resolver/ad2s1200.c
index 55bcbbd4021a..2390822f8546 100644
--- a/drivers/iio/resolver/ad2s1200.c
+++ b/drivers/iio/resolver/ad2s1200.c
@@ -143,18 +143,14 @@ static int ad2s1200_probe(struct spi_device *spi)
st->sdev = 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);
- }
+ if (IS_ERR(st->sample))
+ return dev_err_probe(&spi->dev, PTR_ERR(st->sample),
+ "Failed to claim SAMPLE gpio\n");
st->rdvel = devm_gpiod_get(&spi->dev, "adi,rdvel", GPIOD_OUT_LOW);
- if (IS_ERR(st->rdvel)) {
- dev_err(&spi->dev, "Failed to claim RDVEL gpio: err=%ld\n",
- PTR_ERR(st->rdvel));
- return PTR_ERR(st->rdvel);
- }
+ if (IS_ERR(st->rdvel))
+ return dev_err_probe(&spi->dev, PTR_ERR(st->rdvel),
+ "Failed to claim RDVEL gpio\n");
indio_dev->info = &ad2s1200_info;
indio_dev->modes = INDIO_DIRECT_MODE;
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] iio: resolver: ad2s1200: use dev_err_probe()
2026-07-16 17:03 [PATCH v2] iio: resolver: ad2s1200: use dev_err_probe() Vojtěch Krátký
@ 2026-07-16 18:20 ` Andy Shevchenko
2026-07-18 22:50 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-07-16 18:20 UTC (permalink / raw)
To: Vojtěch Krátký
Cc: nuno.sa, Michael.Hennerich, jic23, dlechner, andy, linux,
linux-iio, linux-kernel
On Thu, Jul 16, 2026 at 07:03:06PM +0200, Vojtěch Krátký wrote:
> Use dev_err_probe() instead of dev_err() to simplify the error path
> and cleanly handle deferred probing.
Wait at least 24h before sending a new version. Please, read the comments
I gave against v1.
...
No need to send a v3, now it's a good time to read comments, discuss, take
other opinions. For example, if Jonathan is okay with v2, it maybe good to
go.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] iio: resolver: ad2s1200: use dev_err_probe()
2026-07-16 18:20 ` Andy Shevchenko
@ 2026-07-18 22:50 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-07-18 22:50 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Vojtěch Krátký, nuno.sa, Michael.Hennerich,
dlechner, andy, linux, linux-iio, linux-kernel
On Thu, 16 Jul 2026 21:20:23 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Thu, Jul 16, 2026 at 07:03:06PM +0200, Vojtěch Krátký wrote:
> > Use dev_err_probe() instead of dev_err() to simplify the error path
> > and cleanly handle deferred probing.
>
> Wait at least 24h before sending a new version. Please, read the comments
> I gave against v1.
>
> ...
>
> No need to send a v3, now it's a good time to read comments, discuss, take
> other opinions. For example, if Jonathan is okay with v2, it maybe good to
> go.
I think Andy's suggestion was a good one, but given it would involve a couple
of patches to add it and convert other places it can be used, probably followed
by an update of this patch, I'm going to take this now and suggest anyone who
is interested can revisit Andy's comments.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-18 22:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 17:03 [PATCH v2] iio: resolver: ad2s1200: use dev_err_probe() Vojtěch Krátký
2026-07-16 18:20 ` Andy Shevchenko
2026-07-18 22:50 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox