diff options
author | Shreeya Patel | 2018-02-06 22:31:57 +0530 |
---|---|---|
committer | Jonathan Cameron | 2018-02-10 15:29:13 +0000 |
commit | 0bd39455b14475e94ccedefabe202fb49460211b (patch) | |
tree | 2d990b036d1f8b943ba3a45dd1d9a934235f352a /lib/cpumask.c | |
parent | c87742abfc80b3f80c4f7a546193ad78e4fed9b6 (diff) |
Staging: iio: ade7758: Expand buf_lock to cover both buffer and state protection
iio_dev->mlock is to be used only by the IIO core for protecting
device mode changes between INDIO_DIRECT and INDIO_BUFFER.
This patch replaces the use of mlock with the already established
buf_lock mutex.
Introducing 'unlocked' forms of read and write registers. The
read/write frequency functions now require buf_lock to be held.
That's not obvious so avoid this but moving the locking inside
the functions where it is then clear that they are taking the
unlocked forms of the register read/write.
It isn't readily apparent that write frequency function requires
the locks to be taken, so move it inside the function to where it
is required to protect.
Also, the read raw does not require iio_dev->mlock for
reads. It can run concurrently as resource protection is handled
by buf_lock in read register.
Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'lib/cpumask.c')
0 files changed, 0 insertions, 0 deletions