Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v3] staging: iio: accel: adis16201: remove iio_dev mlock
@ 2017-03-17 21:43 Aishwarya Pant
  2017-03-18 16:30 ` [Outreachy kernel] " Alison Schofield
  2017-03-19 10:19 ` Jonathan Cameron
  0 siblings, 2 replies; 5+ messages in thread
From: Aishwarya Pant @ 2017-03-17 21:43 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	Hartmut Knaack, Peter Meerwald-Stadler, Greg Kroah-Hartman,
	Barry Song
  Cc: outreachy-kernel, linux-iio

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

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>

---
Changes in v3:
	-- Fix change log format
	-- Send patch to linuc-iio
Changes in v2:
	-- Remove read lock

 drivers/staging/iio/accel/adis16201.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16201.c b/drivers/staging/iio/accel/adis16201.c
index d6c8658..fd2baf2 100644
--- a/drivers/staging/iio/accel/adis16201.c
+++ b/drivers/staging/iio/accel/adis16201.c
@@ -223,17 +223,13 @@ 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;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-03-20 19:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-17 21:43 [PATCH v3] staging: iio: accel: adis16201: remove iio_dev mlock Aishwarya Pant
2017-03-18 16:30 ` [Outreachy kernel] " Alison Schofield
2017-03-19 10:19 ` Jonathan Cameron
2017-03-20 10:34   ` Aishwarya Pant
2017-03-20 19:36     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox