iio: adc: ad9467: use dev_err_probe()

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@analog.com>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Antoniu Miclaus 2026-03-30 14:18:55 +03:00 committed by Jonathan Cameron
parent ba1ad6b2de
commit 8b6e738829

View File

@ -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;