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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2015 23:55:52 +0000 (16:55 -0700)
commit50739084df91db8c50bfa7e06129f3c394fe2552
tree4503fcc6adb4d5437f2cbc41033e5e384abaa9b8
parentbeed1a251c8a3b3ba2777c5e75db4cfa23b463ae
iio: adis16400: Compute the scan mask from channel indices

commit c2a8b623a089d52c199e305e7905829907db8ec8 upstream.

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")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/imu/adis16400.h
drivers/iio/imu/adis16400_core.c