Skip to contentSkip to conversation

staging: iio: accel: adis16201: remove iio_dev mlock

PATCH Superseded Aishwarya Pant 1 participant 1 message Mar 18, 2017

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: iio: accel: adis16201: remove iio_dev mlock

In the driver adis16201 read_raw(..) does not require an iio_dev->mlock. It can run concurrently as adis_read_reg_16() is protected by a transaction lock.

Changes in v2:
-- Remove read lock

---
 drivers/staging/iio/accel/adis16201.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/staging/iio/accel/adis16201.c +2 -5
index d6c8658..3b8e0e1 100644
@@ -223,17 +223,14 @@ static int adis16201_read_raw(struct iio_dev *indio_dev,
 		default:
 			return -EINVAL;
 		}
-		mutex_lock(&indio_dev->mlock);
 		addr = adis16201_addresses[chan->scan_index];
 		ret = adis_read_reg_16(st, addr, &val16);
-		if (ret) {
-			mutex_unlock(&indio_dev->mlock);
+		if (ret)
 			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;
Signature · 1 line
2.7.4