Re: [PATCH 12/13] iio: adc: ad9467: use dev_err_probe

From: Tomas Melin

Date: Mon Mar 30 2026 - 08:07:10 EST



On 30/03/2026 14:18, Antoniu Miclaus wrote:
Use dev_err_probe() instead of dev_err() in the probe path to ensure
proper handling of deferred probing and to simplify error handling.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@xxxxxxxxxx>

Reviewed-by: Tomas Melin <tomas.melin@xxxxxxxxxxx>

---
drivers/iio/adc/ad9467.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c
index 0bf67437508f..0c377f9a7f25 100644
--- a/drivers/iio/adc/ad9467.c
+++ b/drivers/iio/adc/ad9467.c
@@ -1349,11 +1349,10 @@ static int ad9467_probe(struct spi_device *spi)
return ret;
id = ad9467_spi_read(st, AN877_ADC_REG_CHIP_ID);
- if (id != st->info->id) {
- dev_err(dev, "Mismatch CHIP_ID, got 0x%X, expected 0x%X\n",
- id, st->info->id);
- return -ENODEV;
- }
+ if (id != st->info->id)
+ return dev_err_probe(dev, -ENODEV,
+ "Mismatch CHIP_ID, got 0x%X, expected 0x%X\n",
+ id, st->info->id);
if (st->info->num_scales > 1)
indio_dev->info = &ad9467_info;