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