]> git.baikalelectronics.ru Git - kernel.git/commit
staging:iio: Make sure a device is only opened once at a time
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 19 Dec 2011 14:23:45 +0000 (15:23 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Dec 2011 21:38:08 +0000 (13:38 -0800)
commit886fecfb2c89228e48e6e60440e99b2bf0856250
treefb57bb214b5721edeb64f050bd4ceeb0892d1eef
parent6f05eca024a5bd49b36a68683d1aa861efd890f4
staging:iio: Make sure a device is only opened once at a time

Our buffer implementation does not support multiple concurrent readers. So we
have to ensure that a device is only opened once at a time. So do the same thing
we do for the event fd and introduce a per device busy flag. The flag gets set
when opening the device and gets cleared when closing the device. If a open is
attempted while the busy flag is set we return -EBUSY.

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/iio.h
drivers/staging/iio/industrialio-core.c