From patchwork Thu Mar 5 16:04:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11422275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F38DE138D for ; Thu, 5 Mar 2020 16:05:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D13122072D for ; Thu, 5 Mar 2020 16:05:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MlPoyUr9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D13122072D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=98zRAkEmJmQKxyGh7oyz4WoYamW8LpvdAqgi/z1aWFA=; b=MlPoyUr917Ug8q TpHIkfLH1IO7Z6dH7TxWv8Sd78q5CKyu8ieaOLWiUMcWY6jgvQTgb95Fv8jnpQbQF8Cqbz6w9Ae+x yjJdtgpp2uewhVhkvXB15syNSYvwvz1BE1lMINzn2K1b65Ta9/aaUjIV2x68BZJzAznMerC/C5xVT LJMQTzzDdWUK+krj0PZKTVNTDlBqRNszT0YPMG0IYeY2LwIwNd6KGODbuhkrlO8INjdRa5lR4gZLJ G0784C3aESasXBUodoZRApLSi6XWETlQjaataAEfw/tkjcf19z7L7cptViNMgJIx3qYLarpZgQFnn WUqvqOd3qkA3ffEDoRJA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9t01-0002a8-Iv; Thu, 05 Mar 2020 16:05:25 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9szy-0002YR-SF for linux-arm-kernel@lists.infradead.org; Thu, 05 Mar 2020 16:05:24 +0000 X-Originating-IP: 86.202.111.97 Received: from localhost (lfbn-lyo-1-16-97.w86-202.abo.wanadoo.fr [86.202.111.97]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 3DB26E0015; Thu, 5 Mar 2020 16:04:58 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni , Barry Song Subject: [PATCH 1/3] rtc: sirfsoc: convert to devm_rtc_allocate_device Date: Thu, 5 Mar 2020 17:04:50 +0100 Message-Id: <20200305160452.27808-1-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200305_080523_053131_C08C878F X-CRM114-Status: GOOD ( 12.80 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.196 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [217.70.183.196 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This allows further improvement of the driver. Also remove the unnecessary error string as the core will already display error messages. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-sirfsoc.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c index a2c9c55667cd..b2e72597eee8 100644 --- a/drivers/rtc/rtc-sirfsoc.c +++ b/drivers/rtc/rtc-sirfsoc.c @@ -341,28 +341,21 @@ static int sirfsoc_rtc_probe(struct platform_device *pdev) rtcdrv->overflow_rtc = sirfsoc_rtc_readl(rtcdrv, RTC_SW_VALUE); - rtcdrv->rtc = devm_rtc_device_register(&pdev->dev, pdev->name, - &sirfsoc_rtc_ops, THIS_MODULE); - if (IS_ERR(rtcdrv->rtc)) { - err = PTR_ERR(rtcdrv->rtc); - dev_err(&pdev->dev, "can't register RTC device\n"); - return err; - } + rtcdrv->rtc = devm_rtc_allocate_device(&pdev->dev); + if (IS_ERR(rtcdrv->rtc)) + return PTR_ERR(rtcdrv->rtc); + + rtcdrv->rtc->ops = &sirfsoc_rtc_ops; rtcdrv->irq = platform_get_irq(pdev, 0); - err = devm_request_irq( - &pdev->dev, - rtcdrv->irq, - sirfsoc_rtc_irq_handler, - IRQF_SHARED, - pdev->name, - rtcdrv); + err = devm_request_irq(&pdev->dev, rtcdrv->irq, sirfsoc_rtc_irq_handler, + IRQF_SHARED, pdev->name, rtcdrv); if (err) { dev_err(&pdev->dev, "Unable to register for the SiRF SOC RTC IRQ\n"); return err; } - return 0; + return rtc_register_device(rtcdrv->rtc); } #ifdef CONFIG_PM_SLEEP From patchwork Thu Mar 5 16:04:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11422279 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C2F97138D for ; Thu, 5 Mar 2020 16:06:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A054220848 for ; Thu, 5 Mar 2020 16:06:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XTOOt883"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="btYxyMTJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A054220848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2+2M7iFiHzfEfy9uQiCJM+or5gEjo+ze39zFShxjBJw=; b=XTOOt8838iU6a5 77fyZN+RF17mMANYTbDJ1FE/US/RD7veLZXtG0GnYnSlgRhqY/NtdT3mdbVtqDxrISneFkNDjgPwG BSmJzvhD7I0NqOkHoxelHk7LQEyyscFnvINYrko+TLwofi7rBSLCMsTkvzI39f/kg+PS6JmG8Pj7N 7Y71TpmoklZetwTCxoL4e0VPnVrZc9ouN0YYAo9OyyLlF9+K+HcGWSh67eYOmyB8cDcX1uQ64yB5v qrItr65k+7dyTsFgyYyMdG3hkXySORc4Ej/GCyMCnw21v4ytXErCT3QNDqDM7iNreu6KMtCXTVZOc sTNbwdLVGifblcZZEZtA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9t0e-00035S-CM; Thu, 05 Mar 2020 16:06:04 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9t0d-00035B-8i for linux-arm-kernel@bombadil.infradead.org; Thu, 05 Mar 2020 16:06:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=pIsw88VH1U+vvXW3xVej+PObKKgnaGezEeRfG6UWs7M=; b=btYxyMTJafxRpCE3HM3+X17ece BFjelNQMls7mA8k/qZgLsYnh2qZ4hBCPYMxb/7kAxX4W39ux6OpIO7hZ0Y6uK0SreaU+EFQOQ7/v5 s32yIprE6gRJvzwZpzACTqPozqCo5W/rWnIiR7CraEBP/mtfOyALcCfLCmdIvcSKvhaWaJ+LqGomo KtZddSszWOc+waFA1TWw8Md7ns2AnTOdtfPyhtNSODx7pnHkPl3AUyAQDNEzTq7PnSClWeliBOHwQ TfVCfvGCDZKR5f1OG/UcoOutMzYnBJFoVyy9lguZAV89zNfX2Qfo54so32tTi/4ngRU3WNHQ4dCLq /Z5jpMlw==; Received: from relay10.mail.gandi.net ([217.70.178.230]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9t0Z-000208-5g for linux-arm-kernel@lists.infradead.org; Thu, 05 Mar 2020 16:06:01 +0000 Received: from localhost (lfbn-lyo-1-16-97.w86-202.abo.wanadoo.fr [86.202.111.97]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id E37DE240005; Thu, 5 Mar 2020 16:05:03 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni , Barry Song Subject: [PATCH 2/3] rtc: sirfsoc: set range Date: Thu, 5 Mar 2020 17:04:51 +0100 Message-Id: <20200305160452.27808-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200305160452.27808-1-alexandre.belloni@bootlin.com> References: <20200305160452.27808-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200305_160559_359527_71FA17DB X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.3 on casper.infradead.org summary: Content analysis details: (-2.6 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.178.230 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This RTC is a 32bit counter running at 16Hz. This overflows every eight years and a half. However, the driver uses the SW_VALUE register to store the overflow, extending the counter to 64bit as long as the update happens before the overflow. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-sirfsoc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c index b2e72597eee8..8b3c88fb9793 100644 --- a/drivers/rtc/rtc-sirfsoc.c +++ b/drivers/rtc/rtc-sirfsoc.c @@ -346,6 +346,7 @@ static int sirfsoc_rtc_probe(struct platform_device *pdev) return PTR_ERR(rtcdrv->rtc); rtcdrv->rtc->ops = &sirfsoc_rtc_ops; + rtcdrv->rtc->range_max = (1ULL << 60) - 1; rtcdrv->irq = platform_get_irq(pdev, 0); err = devm_request_irq(&pdev->dev, rtcdrv->irq, sirfsoc_rtc_irq_handler, From patchwork Thu Mar 5 16:04:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11422277 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D94B138D for ; Thu, 5 Mar 2020 16:05:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0041D20848 for ; Thu, 5 Mar 2020 16:05:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mCX6otg1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0041D20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jqs69g4eMXPVuGhVWcQUTvj68iFo9wn/KLiN5rOfb2U=; b=mCX6otg18j0aSd 55L88MBg8fz8Xl61oCcTzwc1IaxPZohDMYBe7V9+D2a24kbcR3Fu9TKCnCEtvgJM1/rVO1VEg1Tyv o+XZm1t028939GdmsOgDx1OyREAsnMxIDic7r4B5CTMAbblWjlgBtT1toB2LsPbpPdr6GGKjj4SaB 3AFQK7Tu3qlZF4R3xJ0Kw1tf5whor8NbaBEIxuPbZsXK6V6iTcc2ugqmr9mX2M6niH3V7rcppx8VJ MzrQkrF6RDjzb1V10wEOPK6TDjY+KlksLgSZ81zrFZIRVfmyRhpt+R4t0yo5otD8ldD5tB5+FV29q CtYdfBWdmyu5C8iE7dAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9t0E-0002n1-DE; Thu, 05 Mar 2020 16:05:38 +0000 Received: from relay12.mail.gandi.net ([217.70.178.232]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j9t0B-0002ia-4E for linux-arm-kernel@lists.infradead.org; Thu, 05 Mar 2020 16:05:37 +0000 Received: from localhost (lfbn-lyo-1-16-97.w86-202.abo.wanadoo.fr [86.202.111.97]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 3058B20000B; Thu, 5 Mar 2020 16:05:14 +0000 (UTC) From: Alexandre Belloni To: Alessandro Zummo , Alexandre Belloni , Barry Song Subject: [PATCH 3/3] rtc: sirfsoc: switch to rtc_time64_to_tm/rtc_tm_to_time64 Date: Thu, 5 Mar 2020 17:04:52 +0100 Message-Id: <20200305160452.27808-3-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200305160452.27808-1-alexandre.belloni@bootlin.com> References: <20200305160452.27808-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200305_080535_739745_2029B8EC X-CRM114-Status: GOOD ( 13.07 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.178.232 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Call the 64bit versions of rtc_tm time conversion to avoid the y2106 issue. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-sirfsoc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/rtc/rtc-sirfsoc.c b/drivers/rtc/rtc-sirfsoc.c index 8b3c88fb9793..15f4577ddaef 100644 --- a/drivers/rtc/rtc-sirfsoc.c +++ b/drivers/rtc/rtc-sirfsoc.c @@ -90,13 +90,13 @@ static int sirfsoc_rtc_read_alarm(struct device *dev, */ /* if alarm is in next overflow cycle */ if (rtc_count > rtc_alarm) - rtc_time_to_tm((rtcdrv->overflow_rtc + 1) - << (BITS_PER_LONG - RTC_SHIFT) - | rtc_alarm >> RTC_SHIFT, &(alrm->time)); + rtc_time64_to_tm((rtcdrv->overflow_rtc + 1) + << (BITS_PER_LONG - RTC_SHIFT) + | rtc_alarm >> RTC_SHIFT, &alrm->time); else - rtc_time_to_tm(rtcdrv->overflow_rtc - << (BITS_PER_LONG - RTC_SHIFT) - | rtc_alarm >> RTC_SHIFT, &(alrm->time)); + rtc_time64_to_tm(rtcdrv->overflow_rtc + << (BITS_PER_LONG - RTC_SHIFT) + | rtc_alarm >> RTC_SHIFT, &alrm->time); if (sirfsoc_rtc_readl(rtcdrv, RTC_STATUS) & SIRFSOC_RTC_AL0E) alrm->enabled = 1; @@ -113,7 +113,7 @@ static int sirfsoc_rtc_set_alarm(struct device *dev, rtcdrv = dev_get_drvdata(dev); if (alrm->enabled) { - rtc_tm_to_time(&(alrm->time), &rtc_alarm); + rtc_alarm = rtc_tm_to_time64(&alrm->time); spin_lock_irq(&rtcdrv->lock); @@ -181,8 +181,8 @@ static int sirfsoc_rtc_read_time(struct device *dev, cpu_relax(); } while (tmp_rtc != sirfsoc_rtc_readl(rtcdrv, RTC_CN)); - rtc_time_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) | - tmp_rtc >> RTC_SHIFT, tm); + rtc_time64_to_tm(rtcdrv->overflow_rtc << (BITS_PER_LONG - RTC_SHIFT) + | tmp_rtc >> RTC_SHIFT, tm); return 0; } @@ -193,7 +193,7 @@ static int sirfsoc_rtc_set_time(struct device *dev, struct sirfsoc_rtc_drv *rtcdrv; rtcdrv = dev_get_drvdata(dev); - rtc_tm_to_time(tm, &rtc_time); + rtc_time = rtc_tm_to_time64(tm); rtcdrv->overflow_rtc = rtc_time >> (BITS_PER_LONG - RTC_SHIFT);