diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-07-02 08:52:56 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-07-08 15:02:23 -0400 |
commit | e1dc7bee745f74b42685b4b0b0a24895966e545e (patch) | |
tree | ac17495a44a52a3197f8cba56d80b611cd78e732 /drivers/iio/industrialio-buffer.c | |
parent | 0932966b1ca03217c6e0c18375867b1a99ee5af0 (diff) |
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>
Diffstat (limited to 'drivers/iio/industrialio-buffer.c')
-rw-r--r-- | drivers/iio/industrialio-buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 3d8d187eef2a..096a6bfe0cdf 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c | |||
@@ -292,7 +292,7 @@ int iio_buffer_register(struct iio_dev *indio_dev, | |||
292 | if (channels[i].scan_index > | 292 | if (channels[i].scan_index > |
293 | (int)indio_dev->masklength - 1) | 293 | (int)indio_dev->masklength - 1) |
294 | indio_dev->masklength | 294 | indio_dev->masklength |
295 | = indio_dev->channels[i].scan_index + 1; | 295 | = channels[i].scan_index + 1; |
296 | 296 | ||
297 | ret = iio_buffer_add_channel_sysfs(indio_dev, | 297 | ret = iio_buffer_add_channel_sysfs(indio_dev, |
298 | &channels[i]); | 298 | &channels[i]); |