mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
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:
parent
655c5e04e1
commit
567485a8e6
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user