Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3118877pxb; Tue, 19 Jan 2021 14:25:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOqCg1SxSVbqgQOwIlLxNgfJsu+M6oE1Eq9/UMbYizWncWuj72QolYK0Q06rFqoOorMHWk X-Received: by 2002:a17:906:48f:: with SMTP id f15mr4343526eja.392.1611095146165; Tue, 19 Jan 2021 14:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611095146; cv=none; d=google.com; s=arc-20160816; b=HVDyGXEB4NEVrBz+umKHEYvDTprKoNqIBzJhWtkrivC/0HWgQGkpbiy1jvMECzxMK7 klLNMlj77Nz4yaTuRtOs4B3mWQoD3254Je6uM4DkMXVuSAUGT64hqQYs/SxLGn//LIc2 XBp9CYlvV7Y7acSOYmhYxewahuJolZ+7AUxkp2Q3GaV5vAc3TWI1birn8qoetBIQhkS8 VjSy0oxtVk42n3LZGcRFtbvUUoXZrph665zquI6gwjGLMdEkKCA3Nv7v84BbB1xG/dWA SpWSnZaDsPzRiqFobk9G0b9LL4A8LtqM1gOrpu9jW9dPb1aqWl3q5Lj8B61GFThqnI+G o1Tw== 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=D5JRP5lt8qttbagL4mOBmUWIyYGn9yKD25SCefbmTmo=; b=VSUPn8LPAMcWyCECSU+ypWycBdq5HQyCeoimqOEstJebaLm3JtiRNN+19BgC1QywVz 3Zhz2UAqnW2tm9tavRPJGCPGCM4QNidvUaYNBzWEtx1nEA4GxlReYRSMPxupD4abw3NX Y4B4eBIcXu50WYgkHkaMPH0q7wCj1zvBFXZuRRo0E2J2aShUhnQ9HlAng7yTlcUeSfDd Hpb3MwqUmNSCAgPJRdlVGt7hb9U/HfXMaG25Yzpg2OnIIcFrlKTP/BjJji2y4NCf8Jhu qk6e567stETqjbjnR6z+xKBX75e0D6LTKC1fjMN0hsxtKkVUzAoeF28yV3RsTzQmMgnO GBwQ== 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 g10si43914ejf.344.2021.01.19.14.25.17; Tue, 19 Jan 2021 14:25:46 -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 S1729236AbhASWXE (ORCPT + 99 others); Tue, 19 Jan 2021 17:23:04 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:53081 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729360AbhASWIH (ORCPT ); Tue, 19 Jan 2021 17:08:07 -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 relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 03C401C0003; Tue, 19 Jan 2021 22:06:57 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 03/14] rtc: ds1305: use rtc_lock/rtc_unlock Date: Tue, 19 Jan 2021 23:06:41 +0100 Message-Id: <20210119220653.677750-3-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-ds1305.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-ds1305.c b/drivers/rtc/rtc-ds1305.c index 8c2ab29c3d91..9ef107b99b65 100644 --- a/drivers/rtc/rtc-ds1305.c +++ b/drivers/rtc/rtc-ds1305.c @@ -435,13 +435,12 @@ static const struct rtc_class_ops ds1305_ops = { static void ds1305_work(struct work_struct *work) { struct ds1305 *ds1305 = container_of(work, struct ds1305, work); - struct mutex *lock = &ds1305->rtc->ops_lock; struct spi_device *spi = ds1305->spi; u8 buf[3]; int status; /* lock to protect ds1305->ctrl */ - mutex_lock(lock); + rtc_lock(ds1305->rtc); /* Disable the IRQ, and clear its status ... for now, we "know" * that if more than one alarm is active, they're in sync. @@ -459,7 +458,7 @@ static void ds1305_work(struct work_struct *work) if (status < 0) dev_dbg(&spi->dev, "clear irq --> %d\n", status); - mutex_unlock(lock); + rtc_unlock(ds1305->rtc); if (!test_bit(FLAG_EXITING, &ds1305->flags)) enable_irq(spi->irq); -- 2.29.2