Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1482309pxb; Sat, 30 Oct 2021 14:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymY3mlr6gGIzsskuepPPqhXe+DVyR1N2FHABOYIuMpWMhbhazU3SWPHUPWuvLR4oBtrpTd X-Received: by 2002:a17:907:d8d:: with SMTP id go13mr24169439ejc.242.1635630608257; Sat, 30 Oct 2021 14:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635630608; cv=none; d=google.com; s=arc-20160816; b=VYLOm6I9FH45qNAJ+9y9JjO89ElupY16m/e5KDz39uA8aiAy3Zqxu11THQDOQzLAZr DsPnYsNDz+QTi6lTeW3M8GJ1VCZ78QwE+x9393vn4Bm863MPCt3YxOleMiodoV8XeG0S PZFSWbpX2yBTeIfrOEpXACJ03eOuA+aWp+ZWMtPo/FfRNiZFZW0z9kDM7Zopu4QUsRWs XWtSkTLzlwhIwEGmsMzWExgaPjK+mCJZsEHrGIyhqpnQvfVmvoTgltvtieFzus5ita96 emgE5wOrNkw6Uzb5VdvUXVV4nYEI9Vp9RtR4DV53xIL+kKEydpZ+COjiHNC1IC9rjFae TxUQ== 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 :dkim-signature; bh=eA+1Uvi9uXhmLNb3F2vvtxmwBMjqDbDxzc36ZQojcgk=; b=lxIgyc3dBCV6kpmIQ3eCMgPA3kkJq3fy0gc1wDPt7KYtR60Zxp3WwCerocQkp0b3+S 4Gz/Jysizfpgiu+b4U0u/QMHbR16VKAgRKS5enVv3iARlRmU2J0/ogj/SXzsgWgFI4hN GeXDOzj4hmtLFUNOG3Fpn7c9STV+IC0jTMRRrY8u6lQb93UnlBilOAmULay/O2SkAa/Z YTo5ATwsCJxGnMrq0HcP7TXBefr2s6QHS29VlJ7uCUPzmt47dE9S2ZTW83awAbzM9He4 CO+YuEF++tidX7P3a32CKG9i3nGDS8sZjfsTCwNot7lC2ep5Cs2Arfg7hA5Sxx56gdYC jy6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@o2.pl header.s=1024a header.b=AkX4KxZw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=o2.pl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si3392733edm.110.2021.10.30.14.49.45; Sat, 30 Oct 2021 14:50:08 -0700 (PDT) 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; dkim=pass (test mode) header.i=@o2.pl header.s=1024a header.b=AkX4KxZw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=o2.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232090AbhJ3VuY (ORCPT + 99 others); Sat, 30 Oct 2021 17:50:24 -0400 Received: from mx-out.tlen.pl ([193.222.135.142]:51750 "EHLO mx-out.tlen.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232057AbhJ3VuN (ORCPT ); Sat, 30 Oct 2021 17:50:13 -0400 Received: (wp-smtpd smtp.tlen.pl 24702 invoked from network); 30 Oct 2021 23:47:37 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=o2.pl; s=1024a; t=1635630458; bh=eA+1Uvi9uXhmLNb3F2vvtxmwBMjqDbDxzc36ZQojcgk=; h=From:To:Cc:Subject; b=AkX4KxZwRNa1Wzxh5OpWP10r6IEc4FUpua4mP40zDdVDVX4HFKbvhzX504lHIy4Vb B8LNhYov3LvtlBvdoLc3RWS/uorlMRRDxYgunPogmIKIBFkKj2Wj2MhelmbKv6p2BH JMvRTRdspUZd0JQwW4H1ZQ+3cK6rpWpdKsvfjhvg= Received: from ablz112.neoplus.adsl.tpnet.pl (HELO localhost.localdomain) (mat.jonczyk@o2.pl@[83.7.219.112]) (envelope-sender ) by smtp.tlen.pl (WP-SMTPD) with SMTP for ; 30 Oct 2021 23:47:37 +0200 From: =?UTF-8?q?Mateusz=20Jo=C5=84czyk?= To: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?UTF-8?q?Mateusz=20Jo=C5=84czyk?= , Alessandro Zummo , Alexandre Belloni Subject: [PATCH v3 5/7] rtc-mc146818-lib: refactor mc146818_does_rtc_work Date: Sat, 30 Oct 2021 23:46:33 +0200 Message-Id: <20211030214636.49602-6-mat.jonczyk@o2.pl> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211030214636.49602-1-mat.jonczyk@o2.pl> References: <20211030214636.49602-1-mat.jonczyk@o2.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-WP-MailID: 558c78463bfb96b244ff17e05871cb02 X-WP-AV: skaner antywirusowy Poczty o2 X-WP-SPAM: NO 0000000 [0QPU] Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Refactor mc146818_get_time() to make use of mc146818_do_avoiding_UIP(). It is enough to call mc146818_do_avoiding_UIP() with no callback. Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni --- drivers/rtc/rtc-mc146818-lib.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/drivers/rtc/rtc-mc146818-lib.c b/drivers/rtc/rtc-mc146818-lib.c index f3178244db37..09d6c20726c1 100644 --- a/drivers/rtc/rtc-mc146818-lib.c +++ b/drivers/rtc/rtc-mc146818-lib.c @@ -83,22 +83,7 @@ EXPORT_SYMBOL_GPL(mc146818_do_avoiding_UIP); */ bool mc146818_does_rtc_work(void) { - int i; - unsigned char val; - unsigned long flags; - - for (i = 0; i < 10; i++) { - spin_lock_irqsave(&rtc_lock, flags); - val = CMOS_READ(RTC_FREQ_SELECT); - spin_unlock_irqrestore(&rtc_lock, flags); - - if ((val & RTC_UIP) == 0) - return true; - - mdelay(1); - } - - return false; + return mc146818_do_avoiding_UIP(NULL, NULL); } EXPORT_SYMBOL_GPL(mc146818_does_rtc_work); -- 2.25.1