Skip to contentSkip to conversation

iio: adc: ad7793: Add missing error code in ad7793_setup()

PATCH Applied YueHaibing 2 participants 2 messages May 14, 2021 – May 16, 2021

Subsystems (2)
lore
Share & tools
lore

YueHaibing

author
#0 lore raw

PATCH v2 1/1 iio: adc: ad7793: Add missing error code in ad7793_setup()

Set error code while device ID query failed.

Fixes 88bc30548aae ("IIO: ADC: New driver for AD7792/AD7793 3 Channel SPI ADC")

---
v2: use ENODEV instead of EINVAL

 drivers/iio/adc/ad7793.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/ad7793.c +1 -0
index 5e980a06258e..b4f9ac3838e1 100644
@@ -279,6 +279,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
 	id &= AD7793_ID_MASK;
 
 	if (id != st->chip_info->id) {
+		ret = -ENODEV;
 		dev_err(&st->sd.spi->dev, "device ID query failed\n");
 		goto out;
 	}
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 4 lines · On Fri, 14 May 2021 16:02:54 +0800 YueHaibing <[email protected]> wrote:

Set error code while device ID query failed.

Fixes 88bc30548aae ("IIO: ADC: New driver for AD7792/AD7793 3 Channel SPI ADC")

This one is going to be 'interesting' as that bit of code has changed a lot since the fixes tag so chances are we may need to do a manual backport (or several!)

Applied to the fixes-togreg branch of iio.git.

Thanks,

Jonathan

Quoted 18 lines

---
v2: use ENODEV instead of EINVAL

 drivers/iio/adc/ad7793.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/ad7793.c +1 -0
index 5e980a06258e..b4f9ac3838e1 100644
@@ -279,6 +279,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
 	id &= AD7793_ID_MASK;
 
 	if (id != st->chip_info->id) {
+		ret = -ENODEV;
 		dev_err(&st->sd.spi->dev, "device ID query failed\n");
 		goto out;
 	}