OSDN Git Service

iio: adis16400: Compute the scan mask from channel indices
authorPaul Cercueil <paul.cercueil@analog.com>
Fri, 15 May 2015 15:18:36 +0000 (17:18 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sat, 16 May 2015 09:58:36 +0000 (10:58 +0100)
commitc2a8b623a089d52c199e305e7905829907db8ec8
tree5c9cc6e73c81dd98a7aa6ba6b5b5d47babab3a09
parent7323d59862802ca109451eeda9777024a7625509
iio: adis16400: Compute the scan mask from channel indices

We unfortunately can't use ~0UL for the scan mask to indicate that the
only valid scan mask is all channels selected. The IIO core needs the exact
mask to work correctly and not a super-set of it. So calculate the masked
based on the channels that are available for a particular device.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Fixes: 5eda3550a3cc ("staging:iio:adis16400: Preallocate transfer message")
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/imu/adis16400.h
drivers/iio/imu/adis16400_core.c