Skip to content

Commit

Permalink
iio: adc: ad7793: Add missing error code in ad7793_setup()
Browse files Browse the repository at this point in the history
Set error code while device ID query failed.

Fixes: 88bc305 ("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>
  • Loading branch information
YueHaibing authored and Jonathan Cameron committed May 22, 2021
1 parent 01fcf12 commit 4ed243b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iio/adc/ad7793.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 4ed243b

Please sign in to comment.