staging:iio: Fix scan mask update
commit5a2a6e1162d2c63b4bb3e6e3c867f0374e95cd1f
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 8 Dec 2011 17:35:53 +0000 (8 18:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Dec 2011 20:17:36 +0000 (8 12:17 -0800)
treef72afd7a582d9eeb009a7b6273158925e4bb5945
parenta1e44d6ac5577b78ec85833b22d58345b2758ebb
staging:iio: Fix scan mask update

When updating the scan mask we have to check the actual scan mask for if the
channel is already enabled, not the matching scan mask from the available
scan masks. The bit will already be set there and as a result the actual
scan mask will not get updated and the channel stays disabled.

Also fix the return value of iio_scan_el_store which would return 1 instead of
the number of bytes written if the channel was already active in the scan mask.

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/industrialio-buffer.c