staging:iio: Make sure a device is only opened once at a time
commitbb01443e2cdad4ff5b98e00252e93110d00f4392
authorLars-Peter Clausen <lars@metafoo.de>
Mon, 19 Dec 2011 14:23:45 +0000 (19 15:23 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Dec 2011 21:38:08 +0000 (22 13:38 -0800)
treefb57bb214b5721edeb64f050bd4ceeb0892d1eef
parente38c79e0825b673d97cecfb36bae9e859e724f1b
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