Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 187e07d9 authored by Beniamin Bia's avatar Beniamin Bia Committed by Greg Kroah-Hartman
Browse files

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



commit 341826a065660d1b77d89e6335b6095cd654271c 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: 2985a5d8 ("staging: iio: adc: ad7606: Move out of staging")
Reported-by: default avatarRobert Wörle <rwoerle@mibtec.de>
Signed-off-by: default avatarBeniamin Bia <beniamin.bia@analog.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d314b891
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ static int ad7606_reg_access(struct iio_dev *indio_dev,

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;