summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc/ad7266.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/adc/ad7266.c')
-rw-r--r--drivers/iio/adc/ad7266.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c
index 468c2656d2..98648c679a 100644
--- a/drivers/iio/adc/ad7266.c
+++ b/drivers/iio/adc/ad7266.c
@@ -157,6 +157,8 @@ static int ad7266_read_raw(struct iio_dev *indio_dev,
ret = ad7266_read_single(st, val, chan->address);
iio_device_release_direct_mode(indio_dev);
+ if (ret < 0)
+ return ret;
*val = (*val >> 2) & 0xfff;
if (chan->scan_type.sign == 's')
*val = sign_extend32(*val,