Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3110507pxb; Tue, 19 Jan 2021 14:11:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYdh0Ui5DWFIcTGD/wmIqsUr2NhweR9+VukIG8LZSlQYM6ANqAvR8qFZvMNyCnRURkcwdn X-Received: by 2002:a17:907:c2a:: with SMTP id ga42mr4124615ejc.511.1611094304301; Tue, 19 Jan 2021 14:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611094304; cv=none; d=google.com; s=arc-20160816; b=koTtaX61mAgvJXK+6QsXl68iSO7wz1iY3al+5fwFqbD390UYPBUnuEyTflbUPDrQxa Qy5T3+C48iIburBO8hxCyoXAiWqSxDPv8Fc4gqxosigkvaZTj4wymwQXqcFlBqk0jtKB tdsZU3irXvQyEsMQYWrL9bFO5I6Gabo9TNGsTuM1Cm9IVdhoEhN1ygieo/RFQzQT6o7z TwcWyX6ocFF42jgMTbyAsfU/QO2dHdL4GENUXioCUcvn7618PrrpEDKzj1t1vOSEZhcH Ot+QfybsDs5pXN4A6bvy7CnG9fxRPE3Kmf+UDS9PxsJa1TGeh2IWnbmEFcSw8Qj0/Q3i CxSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=YI/yiABZ2uGtCNV+O1KprA3+USuuAObvvEtHsu3Sjvc=; b=NyO+IhxtiJlPO14b+goKhlaf7x84Rc9KmUTK5awGZ72DQBPe1ls4P2SsR74Ou8sdPa o1L/mXFS6G0BT4hgChLsvQW0CUgnSZFTxIRa2K3bKs7u3MRMzEjhCZQzTICcQdJfcK6h bVQHDGo9DZx1yNThOI0TVg3rxqjPs6bNFMEqDzWfzfnhDV53OEkEIv4tthTmRDfwDvva SQR5ZmLUfr9Ls9CYq5bepwqmgMnkys8M4pVsVpCMSRidg+WvvXvYKx9c/CQSRCwOpRsh UPTWY2vXICrc2/3dfJIR7h2FphPS6SUuxkDHPI0MVc6aw42KRoEAO7BJIgtgHbtGcimV FuqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ci17si35465ejc.364.2021.01.19.14.11.17; Tue, 19 Jan 2021 14:11:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729222AbhASWJM (ORCPT + 99 others); Tue, 19 Jan 2021 17:09:12 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:58373 "EHLO relay6-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729436AbhASWII (ORCPT ); Tue, 19 Jan 2021 17:08:08 -0500 X-Originating-IP: 86.202.109.140 Received: from localhost (lfbn-lyo-1-13-140.w86-202.abo.wanadoo.fr [86.202.109.140]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 41DF8C0002; Tue, 19 Jan 2021 22:07:02 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/14] rtc: m41t80: use rtc_lock/rtc_unlock Date: Tue, 19 Jan 2021 23:06:46 +0100 Message-Id: <20210119220653.677750-8-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210119220653.677750-1-alexandre.belloni@bootlin.com> References: <20210119220653.677750-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid accessing directly rtc->ops_lock and use the RTC core helpers. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-m41t80.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index e3ddd660d68c..ee0c1be0354e 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -158,21 +158,20 @@ static irqreturn_t m41t80_handle_irq(int irq, void *dev_id) { struct i2c_client *client = dev_id; struct m41t80_data *m41t80 = i2c_get_clientdata(client); - struct mutex *lock = &m41t80->rtc->ops_lock; unsigned long events = 0; int flags, flags_afe; - mutex_lock(lock); + rtc_lock(m41t80->rtc); flags_afe = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_MON); if (flags_afe < 0) { - mutex_unlock(lock); + rtc_unlock(m41t80->rtc); return IRQ_NONE; } flags = i2c_smbus_read_byte_data(client, M41T80_REG_FLAGS); if (flags <= 0) { - mutex_unlock(lock); + rtc_unlock(m41t80->rtc); return IRQ_NONE; } @@ -189,7 +188,7 @@ static irqreturn_t m41t80_handle_irq(int irq, void *dev_id) flags_afe); } - mutex_unlock(lock); + rtc_unlock(m41t80->rtc); return IRQ_HANDLED; } -- 2.29.2