summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2021-05-14 16:02:54 +0800
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-05-22 08:32:36 +0100
commit4ed243b1da169bcbc1ec5507867e56250c5f1ff9 (patch)
tree0ae9508fe1b6d38b9a1435f8f26a61b7d6e788ba
parent01fcf129f61b26d5b3d2d8afb03e770dee271bc8 (diff)
downloadlinux-stable-4ed243b1da169bcbc1ec5507867e56250c5f1ff9.tar.gz
linux-stable-4ed243b1da169bcbc1ec5507867e56250c5f1ff9.tar.bz2
linux-stable-4ed243b1da169bcbc1ec5507867e56250c5f1ff9.zip
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") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r--drivers/iio/adc/ad7793.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c
index 5e980a06258e..440ef4c7be07 100644
--- a/drivers/iio/adc/ad7793.c
+++ b/drivers/iio/adc/ad7793.c
@@ -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;
}