iio: querying buffer scan_mask should return 0/1
authorAlec Berg <alecaberg@chromium.org>
Wed, 19 Mar 2014 18:50:00 +0000 (18:50 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 6 May 2014 14:55:29 +0000 (07:55 -0700)
commit4b034e7b55357d8fae469134405360d508d42f84
tree1b3b605a9eff9bca64ec8fd5e0e81960a0b87691
parent297d5df003afe5b1a096ca9877e9c5cc8d99396a
iio: querying buffer scan_mask should return 0/1

commit 2076a20fc1a06f7b0333c62a2bb4eeeac7ed1bcb upstream.

Ensure that querying the IIO buffer scan_mask returns a value of
0 or 1. Currently querying the scan mask has the value returned
by test_bit(), which returns either true or false. For some
architectures test_bit() may return -1 for true, which will appear
to return an error when returning from iio_scan_mask_query().

Additionally, it's important for the sysfs interface to consistently
return the same thing when querying the scan_mask.

Signed-off-by: Alec Berg <alecaberg@chromium.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/industrialio-buffer.c