Skip to content

Commit

Permalink
iio: iio_buffer_register: Use correct channel when calculating maskle…
Browse files Browse the repository at this point in the history
…ngth

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>
  • Loading branch information
Lars-Peter Clausen authored and Jonathan Cameron committed Jul 8, 2012
1 parent 0932966 commit e1dc7be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/industrialio-buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ int iio_buffer_register(struct iio_dev *indio_dev,
if (channels[i].scan_index >
(int)indio_dev->masklength - 1)
indio_dev->masklength
= indio_dev->channels[i].scan_index + 1;
= channels[i].scan_index + 1;

ret = iio_buffer_add_channel_sysfs(indio_dev,
&channels[i]);
Expand Down

0 comments on commit e1dc7be

Please sign in to comment.