[PATCH 5/7] iio: adc: ade9000: use dev_err_probe in probe path

Antoniu Miclaus posted 7 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH 5/7] iio: adc: ade9000: use dev_err_probe in probe path
Posted by Antoniu Miclaus 1 month, 2 weeks ago
Replace dev_err() + return with dev_err_probe() in ade9000_reset(),
which is called during probe. This simplifies error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 drivers/iio/adc/ade9000.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index db085dc5e526..5dcc26a08970 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -1589,10 +1589,9 @@ static int ade9000_reset(struct ade9000_state *st)
 	/* Only wait for completion if IRQ1 is available to signal reset done */
 	if (fwnode_irq_get_byname(dev_fwnode(dev), "irq1") >= 0) {
 		if (!wait_for_completion_timeout(&st->reset_completion,
-						 msecs_to_jiffies(1000))) {
-			dev_err(dev, "Reset timeout after 1s\n");
-			return -ETIMEDOUT;
-		}
+						 msecs_to_jiffies(1000)))
+			return dev_err_probe(dev, -ETIMEDOUT,
+					     "Reset timeout after 1s\n");
 	}
 	/* If no IRQ available, reset is already complete after the 50ms delay above */
 
-- 
2.43.0
Re: [PATCH 5/7] iio: adc: ade9000: use dev_err_probe in probe path
Posted by Jonathan Cameron 1 month, 1 week ago
On Fri, 20 Feb 2026 15:11:43 +0200
Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:

> Replace dev_err() + return with dev_err_probe() in ade9000_reset(),
> which is called during probe. This simplifies error handling.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Applied this one, but tweaked title to include dev_err_probe()
(added the brackets)

I think Andy's feedback applies to all the rest of the series so I'll wait for
v2 for those.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/ade9000.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
> index db085dc5e526..5dcc26a08970 100644
> --- a/drivers/iio/adc/ade9000.c
> +++ b/drivers/iio/adc/ade9000.c
> @@ -1589,10 +1589,9 @@ static int ade9000_reset(struct ade9000_state *st)
>  	/* Only wait for completion if IRQ1 is available to signal reset done */
>  	if (fwnode_irq_get_byname(dev_fwnode(dev), "irq1") >= 0) {
>  		if (!wait_for_completion_timeout(&st->reset_completion,
> -						 msecs_to_jiffies(1000))) {
> -			dev_err(dev, "Reset timeout after 1s\n");
> -			return -ETIMEDOUT;
> -		}
> +						 msecs_to_jiffies(1000)))
> +			return dev_err_probe(dev, -ETIMEDOUT,
> +					     "Reset timeout after 1s\n");
>  	}
>  	/* If no IRQ available, reset is already complete after the 50ms delay above */
>