]> git.baikalelectronics.ru Git - kernel.git/commit
staging:iio: Fix scan mask update
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 8 Dec 2011 17:35:53 +0000 (18:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Dec 2011 20:17:36 +0000 (12:17 -0800)
commit70624d8fe0339267b4a17a1a7eae291bb95a8114
treef72afd7a582d9eeb009a7b6273158925e4bb5945
parentc1e67b161bbd1945a947d0d3b6de2fbe3c6cd69f
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