Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2718542ybh; Mon, 9 Mar 2020 11:33:38 -0700 (PDT) X-Google-Smtp-Source: ADFU+vumZCHx2Puvx29w2ESYC9G/8kpgUlchexDRmHJqORailmJmK31J38xlwFPNmvLKWV0cKJLZ X-Received: by 2002:aca:eb4c:: with SMTP id j73mr29460oih.145.1583778818571; Mon, 09 Mar 2020 11:33:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583778818; cv=none; d=google.com; s=arc-20160816; b=bDwSRLlxEaDbAv2kO3v3UBG38OGdK4TJv3QL/FwY0MOY1q8LsniUMU+lqrgmtV3JRu yNiIK3HVpTQ+6/RuHmQVntvVNXKAKSK7n62YsYIHqz2qqUpbqkj8hBb3h4jyiowqc21i MbCKagLs+quMAtp7sYaXYDIljoKctV98jQaMtRvO7swsreRshDZ5cb4RU5ghc44mRYbh 0FvTeNtKfLZ8BnoUPcfyVvxWO53l7rEbvwhKM/hlz0LjcM5FTjBPc5+L8yrUALxhgUqL +D/C4GltPoU/FhB41RjiyAWCfZu2jNY/U0LyPAd72PgI+YyOTB7UKc42ffzZa0bCnJSy tPcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:subject:cc:to:from:date:message-id:dkim-signature; bh=yraj5Tql8oxf5l1BCisk3gPL3avSiKpNGBiD85oy6HA=; b=zN1xbqiis3IUkloEGxM1e5O/LXdgO6jGHxoFzWFsrrEbmOwJGbW+W8jqqCaOCZI0/k R5MF57z/xmNsRV+CufTf9xnWsexl4Na+PSsHljZP5nGqcY5LMzGo5zdeGuAhghoeh4f4 kpJGdWHJwrhh0in2+r+eOCNv21gQeH69CZlAsY/yESBkzqMEABqNOhhNLGsDYwTuFfki UQNopJmGdWDCV/3afeg14XXjUJpDhd16Xp57+izBHc2Av+X0wwp56DJbzKEU4Y8BZNH6 UwNgVPDKk0QnDc5HIeHCMXR0bJpgdYXxcLz6RI9W+UIpYSNCXr6G7wPHxPxrKsF9s0sQ r3Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="M/TrsNVg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w128si4283950oib.247.2020.03.09.11.33.25; Mon, 09 Mar 2020 11:33:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="M/TrsNVg"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727505AbgCISbk (ORCPT + 99 others); Mon, 9 Mar 2020 14:31:40 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33851 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727467AbgCISbk (ORCPT ); Mon, 9 Mar 2020 14:31:40 -0400 Received: by mail-pg1-f195.google.com with SMTP id t3so5110591pgn.1; Mon, 09 Mar 2020 11:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:to:cc:subject:mime-version:content-disposition :user-agent; bh=yraj5Tql8oxf5l1BCisk3gPL3avSiKpNGBiD85oy6HA=; b=M/TrsNVgPNpqgyAPSWaNXD5hrsdsZxFeSdnV64e+3tLbA1TWaTVO5EJoIkxWXIz4KE +o4+T96PihjHLUpyj7w4RAV6dlqc2FPV1pTlUZUbpbm38h4silLYEMqkqz58WHbzVK6f K8Pv2bGCfUj4MRvy1w9MuBNt23qpm+cd+14rII5BK8OxLizOqca2C2p2eZeAQwYpmS1d ECCKz4lagim+MXgx5CDw3Il8D2F/87olefzBymt3/Dk3sraVsQJkgEdLYeC/fXUt7RBt r6OduFNhJrUXvV5SjVqP48ec+qxFHK2S1x404YQ4R6GbBpA9YLPoN2rDy8Xab++A0rM0 9HMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:to:cc:subject:mime-version :content-disposition:user-agent; bh=yraj5Tql8oxf5l1BCisk3gPL3avSiKpNGBiD85oy6HA=; b=NTtUIgjwpezZQnCd4atRXY+I6DuFX3bfMgiEVq1CviG8RQ1EHpCz/8L6c0Y1zQ2z00 gWPNiXRuQgyDsLD41hKLX9PSuSWz0WpyABOekN5I2YMp7MrYnrpTFMdnIUxTLN1tuJ40 wXG3eOQt99V17ncQ8BkJaoDdjmLCisw5k0U+8rNli/O83oqw2lGKAkvvPimfdKDkPElT fLckJiQKPP/oohjEMP+mVL+F+Sjrj3TLRMKpLuuC0gqFT/gavzh3LpBZaU1hG4JJGvPg QdCgDHHXFg6dYNG3kIm5MHLOnPnFY38zQxPnXdkO81sd7TbMmrJJvqPC10TRYwKBDPp/ pCBw== X-Gm-Message-State: ANhLgQ1wTq9c7yT32Zz9K1v4RoaWlY/3ql/a3wYOqCEzztI6SwVe5ahe GDRwN7ncjBU+SNMahkLYaHL9aTG1gB6sqA== X-Received: by 2002:a62:f84e:: with SMTP id c14mr18455462pfm.6.1583778698671; Mon, 09 Mar 2020 11:31:38 -0700 (PDT) Received: from SARKAR ([2401:4900:330b:b8fc:399a:a833:fab3:83b]) by smtp.gmail.com with ESMTPSA id mr7sm246643pjb.12.2020.03.09.11.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 11:31:37 -0700 (PDT) Message-ID: <5e668b89.1c69fb81.d7e4f.0f61@mx.google.com> X-Google-Original-Message-ID: <20200309183128.GA21734@rohitsarkar5398@gmail.com> Date: Tue, 10 Mar 2020 00:01:28 +0530 From: Rohit Sarkar To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jic23@kernel.org, matt.ranostay@konsulko.com Subject: [PATCH] iio: health: max30100: remove mlock usage MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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