diff options
author | Ian Abbott | 2013-11-08 16:03:25 +0100 |
---|---|---|
committer | Greg Kroah-Hartman | 2013-11-12 01:16:43 +0100 |
commit | bf11c134246e8f3cfa2582a3d2af84ed7dfd59b6 (patch) | |
tree | b8951e6a59b3aedcac6cc20e4df997aaaf841178 /drivers/staging/comedi/comedi_fops.c | |
parent | staging: comedi: add rw_semaphore to protect against device detachment (diff) | |
download | kernel-qcow2-linux-bf11c134246e8f3cfa2582a3d2af84ed7dfd59b6.tar.gz kernel-qcow2-linux-bf11c134246e8f3cfa2582a3d2af84ed7dfd59b6.tar.xz kernel-qcow2-linux-bf11c134246e8f3cfa2582a3d2af84ed7dfd59b6.zip |
staging: comedi: use attach_lock semaphore during attach and detach
Acquire the `attach_lock` semaphore in the `struct comedi_device` while
modifying the `attached` flag. This is a "write" acquire. Note that
the main mutex in the `struct comedi_device` is also held at this time.
Tasks wishing to check the device is attached will need to either
acquire the main mutex, or "read" acquire the `attach_lock` semaphore,
or both in that order.
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
0 files changed, 0 insertions, 0 deletions