summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/accel
diff options
context:
space:
mode:
authorNarcisa Ana Maria Vasile <narcisaanamaria12@gmail.com>2017-03-15 19:00:14 +0200
committerJonathan Cameron <jic23@kernel.org>2017-03-19 11:01:19 +0000
commitae81abcb6a490aff04091aed59baf1c290cc657e (patch)
tree2953b53b50df85997fc0c2d7105164399456976f /drivers/staging/iio/accel
parent91b4b166175066349f01ce67e091355f8f27e4a7 (diff)
staging: iio: adis16209: Remove mutex_lock() and mutex_unlock() calls
The function adis16209_read_raw() is safe to be run in parallel. The call to adis_read_reg_16() is safe since adis_read_reg() uses the txrx_lock from struct adis to protect simultaneous changes. Remove mutex.h inclusion since it is no longer needed. Signed-off-by: Narcisa Ana Maria Vasile <narcisaanamaria12@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio/accel')
-rw-r--r--drivers/staging/iio/accel/adis16209.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/staging/iio/accel/adis16209.c b/drivers/staging/iio/accel/adis16209.c
index 28705bf4ef90..52fa2e0511be 100644
--- a/drivers/staging/iio/accel/adis16209.c
+++ b/drivers/staging/iio/accel/adis16209.c
@@ -7,7 +7,6 @@
*/
#include <linux/delay.h>
-#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
@@ -254,17 +253,14 @@ static int adis16209_read_raw(struct iio_dev *indio_dev,
default:
return -EINVAL;
}
- mutex_lock(&indio_dev->mlock);
addr = adis16209_addresses[chan->scan_index][0];
ret = adis_read_reg_16(st, addr, &val16);
if (ret) {
- mutex_unlock(&indio_dev->mlock);
return ret;
}
val16 &= (1 << bits) - 1;
val16 = (s16)(val16 << (16 - bits)) >> (16 - bits);
*val = val16;
- mutex_unlock(&indio_dev->mlock);
return IIO_VAL_INT;
}
return -EINVAL;