diff options
| author | Narcisa Ana Maria Vasile <[email protected]> | 2017-04-09 10:40:07 +0000 |
|---|---|---|
| committer | Jonathan Cameron <[email protected]> | 2017-04-14 14:09:06 +0000 |
| commit | 984fb2443091d51e196662cdaddfe2823b2778ec (patch) | |
| tree | a27fa15aa9850a522c2ae8a0272110ae74cca13f /drivers/iio/trigger/stm32-timer-trigger.c | |
| parent | iio: adc: add max1117/max1118/max1119 ADC driver (diff) | |
| download | kernel-984fb2443091d51e196662cdaddfe2823b2778ec.tar.gz kernel-984fb2443091d51e196662cdaddfe2823b2778ec.zip | |
staging: iio: ad5933: Protect DIRECT mode using claim/release helpers
This device operates in DIRECT_MODE and BUFFER_HARDWARE mode.
Replace usages of iio_dev->mlock with iio_device_{claim|release}_direct_mode()
helper functions to guarantee DIRECT mode and consequently protect
BUFFER mode too.
Add and use a device private lock to protect against conflicting access of the
state data.
This helps with IIO subsystem redefining iio_dev->mlock to be used by
the IIO core only for protecting device operating mode changes.
ie. Changes between INDIO_DIRECT_MODE, INDIO_BUFFER_* modes.
Protect changing of attributes inside ad5933_store(). Attributes
can no longer be changed while in buffered mode.
Remove lock from ad5933_work() because buffer mode should be enabled
when we reach this, and claiming DIRECT mode in all the other places
should protect it.
Signed-off-by: Narcisa Ana Maria Vasile <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
Diffstat (limited to 'drivers/iio/trigger/stm32-timer-trigger.c')
0 files changed, 0 insertions, 0 deletions
