diff options
author | Nuno Sá <nuno.sa@analog.com> | 2022-10-04 15:49:05 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-11-23 19:43:58 +0000 |
commit | 3cc36cabc669fffa7f04931e3dd25dc47314ec06 (patch) | |
tree | ba159e92f9e4d56a20124d1b35afe5ce5d7ccf31 /include/linux/iio | |
parent | d711a5a7eff4855deb0e2c2663e679dc205e2d9f (diff) |
iio: gyro: itg3200_core: do not use internal iio_dev lock
The iio_device lock is only meant for internal use. Hence define a
device local lock to protect against concurrent accesses.
While at it, properly include "mutex.h" for mutex related APIs.
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20221004134909.1692021-13-nuno.sa@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/iio')
-rw-r--r-- | include/linux/iio/gyro/itg3200.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/iio/gyro/itg3200.h b/include/linux/iio/gyro/itg3200.h index a602fe7b84fa..74b6d1cadc86 100644 --- a/include/linux/iio/gyro/itg3200.h +++ b/include/linux/iio/gyro/itg3200.h @@ -102,6 +102,8 @@ struct itg3200 { struct i2c_client *i2c; struct iio_trigger *trig; struct iio_mount_matrix orientation; + /* lock to protect against multiple access to the device */ + struct mutex lock; }; enum ITG3200_SCAN_INDEX { |