linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: health: max30100: remove mlock usage
@ 2020-03-09 18:31 Rohit Sarkar
  2020-03-15  9:46 ` Jonathan Cameron
  0 siblings, 1 reply; 7+ messages in thread
From: Rohit Sarkar @ 2020-03-09 18:31 UTC (permalink / raw)
  To: linux-iio, linux-kernel; +Cc: jic23, matt.ranostay

Use local lock instead of indio_dev's mlock.
The mlock was being used to protect local driver state thus using the
local lock is a better option here.

Signed-off-by: Rohit Sarkar <rohitsarkar5398@gmail.com>
---
 drivers/iio/health/max30100.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c
index 84010501762d..8ddc4649547d 100644
--- a/drivers/iio/health/max30100.c
+++ b/drivers/iio/health/max30100.c
@@ -388,7 +388,7 @@ static int max30100_read_raw(struct iio_dev *indio_dev,
 		 * Temperature reading can only be acquired while engine
 		 * is running
 		 */
-		mutex_lock(&indio_dev->mlock);
+		mutex_lock(&data->lock);
 
 		if (!iio_buffer_enabled(indio_dev))
 			ret = -EAGAIN;
@@ -399,7 +399,7 @@ static int max30100_read_raw(struct iio_dev *indio_dev,
 
 		}
 
-		mutex_unlock(&indio_dev->mlock);
+		mutex_unlock(&data->lock);
 		break;
 	case IIO_CHAN_INFO_SCALE:
 		*val = 1;  /* 0.0625 */
-- 
2.23.0.385.gbc12974a89


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

end of thread, other threads:[~2020-03-16 11:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-09 18:31 [PATCH] iio: health: max30100: remove mlock usage Rohit Sarkar
2020-03-15  9:46 ` Jonathan Cameron
2020-03-15 10:57   ` Rohit Sarkar
2020-03-15 13:23     ` Jonathan Cameron
2020-03-16  8:21   ` Matt Ranostay
2020-03-16  8:29     ` Matt Ranostay
2020-03-16 11:49       ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).