From: Beniamin Bia Date: Mon, 4 Nov 2019 16:26:34 +0000 (+0200) Subject: iio: adc: ad7606: fix reading unnecessary data from device X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=341826a065660d1b77d89e6335b6095cd654271c;p=linux.git iio: adc: ad7606: fix reading unnecessary data from device When a conversion result is being read from ADC, the driver reads the number of channels + 1 because it thinks that IIO_CHAN_SOFT_TIMESTAMP is also a physical channel. This patch fixes this issue. Fixes: 2985a5d88455 ("staging: iio: adc: ad7606: Move out of staging") Reported-by: Robert Wörle Signed-off-by: Beniamin Bia Cc: Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c index f5ba94c03a8d9..e4683a68522a4 100644 --- a/drivers/iio/adc/ad7606.c +++ b/drivers/iio/adc/ad7606.c @@ -85,7 +85,7 @@ err_unlock: static int ad7606_read_samples(struct ad7606_state *st) { - unsigned int num = st->chip_info->num_channels; + unsigned int num = st->chip_info->num_channels - 1; u16 *data = st->data; int ret;