mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-13 14:14:37 +00:00
iio: iio_buffer_register: Use correct channel when calculating masklength
The channel set assigned to the iio device is not necessarily the same has the channel set passed to iio_buffer_register. So to avoid possible complications always work with the channel set pass to iio_buffer_register and ignore the channel set assigned to the iio device. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
0932966b1c
commit
e1dc7bee74
1 changed files with 1 additions and 1 deletions
|
@ -292,7 +292,7 @@ int iio_buffer_register(struct iio_dev *indio_dev,
|
||||||
if (channels[i].scan_index >
|
if (channels[i].scan_index >
|
||||||
(int)indio_dev->masklength - 1)
|
(int)indio_dev->masklength - 1)
|
||||||
indio_dev->masklength
|
indio_dev->masklength
|
||||||
= indio_dev->channels[i].scan_index + 1;
|
= channels[i].scan_index + 1;
|
||||||
|
|
||||||
ret = iio_buffer_add_channel_sysfs(indio_dev,
|
ret = iio_buffer_add_channel_sysfs(indio_dev,
|
||||||
&channels[i]);
|
&channels[i]);
|
||||||
|
|
Loading…
Reference in a new issue