1
0
Fork 0

iio: adc: ad7606: fix reading unnecessary data from device

commit 341826a065 upstream.

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: 2985a5d884 ("staging: iio: adc: ad7606: Move out of staging")
Reported-by: Robert Wörle <rwoerle@mibtec.de>
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Beniamin Bia 2019-11-04 18:26:34 +02:00 committed by Greg Kroah-Hartman
parent d314b89127
commit 187e07d991
1 changed files with 1 additions and 1 deletions

View File

@ -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;