iio: adc: ad7292: 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>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Antoniu Miclaus 2026-03-30 14:18:50 +03:00 committed by Jonathan Cameron
parent 655c5e04e1
commit 567485a8e6

View File

@ -267,10 +267,9 @@ static int ad7292_probe(struct spi_device *spi)
st->spi = spi;
ret = ad7292_spi_reg_read(st, AD7292_REG_VENDOR_ID);
if (ret != ADI_VENDOR_ID) {
dev_err(&spi->dev, "Wrong vendor id 0x%x\n", ret);
return -EINVAL;
}
if (ret != ADI_VENDOR_ID)
return dev_err_probe(dev, -EINVAL,
"Wrong vendor id 0x%x\n", ret);
ret = devm_regulator_get_enable_read_voltage(dev, "vref");
if (ret < 0 && ret != -ENODEV)