From patchwork Tue Jun 20 09:35:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9799127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8CB4D601BC for ; Tue, 20 Jun 2017 09:50:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F607281E1 for ; Tue, 20 Jun 2017 09:50:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74142283AF; Tue, 20 Jun 2017 09:50:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F3DAE281E1 for ; Tue, 20 Jun 2017 09:50:42 +0000 (UTC) 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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=4DBtTJAJsNvbKe63zesjx3b7wlkzwn8cl8uIg8vmlU4=; b=fgLFu6G+ZXjG78p20VsrbFv8qC JM57AKjmEyz3u9hIeg1wBe9NXJ50OW2VrAkNXyRZEC13/En2Cfi44BT9bEd7hAWKWHTVWKtbGa9AC WHV9vKrTgPSGN3Dak/nelaaN9ZZFbeffsW/gkrrl8Ny3cyET8lQjiFy/iZQcvZCEliP22hK+ZaaG9 gY4kABH42uX4di4vbx8dQ/OQ/YHp+iq0RvmSVNwxheyrDUAKvODR7yv2chb2XV0vxHOLwhKhS4wS8 EnVqbxsqTNOjn0fQ4cjt/DaquNf5us6snbarCHlMTaLeFS55xBJzD//Cp1PywDIdwewHwEukNzKvo BXLdWmOA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dNFnz-0002wv-8O; Tue, 20 Jun 2017 09:50:39 +0000 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dNFc4-00048P-3m for linux-arm-kernel@lists.infradead.org; Tue, 20 Jun 2017 09:38:35 +0000 Received: by mail-wm0-x233.google.com with SMTP id x70so16032424wme.0 for ; Tue, 20 Jun 2017 02:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=YLR3W/7eoAcee1znh2WEacExSu0T2v0U5VM4tCjWBmu2MEeMR9Cf2WNAG8PEcJINo2 CVsaXV/4WI0/xFQMnpNzqMpfJLe5kQRqcIyycT3mM2TiCJj+TBbTt7BZz+0uQbDwwBSZ kiOR/6Qnn8YcT+rN0srE19g5hK161EBAQwHEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3PYykTE2yZSoBGAA9xsOg7AqClvTXcP6I6le/qM9kKc=; b=AnPXEnwDyYKR3MAR3q0VMsLIudBxFYVIELS44L28b5Fx4TkO3TDldR8x3i5z3hxeIq 9Oo4cP9KHpZBs8L7jByTMuqm81PJNwfZRoeDiCxHgd5Svb3vZAKVWslozgCvPgMoFbs5 fKZZbyXXoksKBvOu28J1KL1ggk0Q2eD5zhzmJwsF3fmpu7g3h0rn/vzUJOtf/lYsM4Hp pr+5C+Ect1CPJOsc05RyIQzqh/KKljWRU0YErQWdVleXKa2mW7uyTokE08Bo17elpiWe vDxmDsHtcDk2tNmu37UZEO63pleVQkm/rs7zGK/sbHpKPsyvDLVfQBrdbdYylNXrhth1 heHg== X-Gm-Message-State: AKS2vOxX+tWBXqxT1QZYnq09ur12sMD81esK/n5I89yjRIr6/LBTqj1P SBwpPy0ALkn5T2I84+b6UA== X-Received: by 10.28.22.4 with SMTP id 4mr2047185wmw.68.1497951478229; Tue, 20 Jun 2017 02:37:58 -0700 (PDT) Received: from lmenx321.st.com. ([80.215.93.217]) by smtp.gmail.com with ESMTPSA id e24sm4482318wrc.35.2017.06.20.02.37.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:57 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Subject: [PATCH 26/51] rtc: gemini: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:34 +0200 Message-Id: <1497951359-13334-27-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> References: <1497951359-13334-1-git-send-email-benjamin.gaignard@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170620_023820_690128_B7BD7A2C X-CRM114-Status: GOOD ( 11.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alessandro Zummo , linaro-kernel@lists.linaro.org, rtc-linux@googlegroups.com, Hans Ulli Kroll , linux-kernel@vger.kernel.org, Alexandre Belloni , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP rtc_time_to_tm() and rtc_tm_to_time() are deprecated because they rely on 32bits variables and that will make rtc break in y2038/2016. Stop using those two functions to safer 64bits ones. Signed-off-by: Benjamin Gaignard CC: Hans Ulli Kroll CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org --- drivers/rtc/rtc-gemini.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c index 5279390..222f144 100644 --- a/drivers/rtc/rtc-gemini.c +++ b/drivers/rtc/rtc-gemini.c @@ -71,7 +71,7 @@ static int gemini_rtc_read_time(struct device *dev, struct rtc_time *tm) struct gemini_rtc *rtc = dev_get_drvdata(dev); unsigned int days, hour, min, sec; - unsigned long offset, time; + unsigned long long offset, time; sec = readl(rtc->rtc_base + GEMINI_RTC_SECOND); min = readl(rtc->rtc_base + GEMINI_RTC_MINUTE); @@ -81,7 +81,7 @@ static int gemini_rtc_read_time(struct device *dev, struct rtc_time *tm) time = offset + days * 86400 + hour * 3600 + min * 60 + sec; - rtc_time_to_tm(time, tm); + rtc_time64_to_tm(time, tm); return 0; } @@ -90,12 +90,12 @@ static int gemini_rtc_set_time(struct device *dev, struct rtc_time *tm) { struct gemini_rtc *rtc = dev_get_drvdata(dev); unsigned int sec, min, hour, day; - unsigned long offset, time; + unsigned long long offset, time; if (tm->tm_year >= 2148) /* EPOCH Year + 179 */ return -EINVAL; - rtc_tm_to_time(tm, &time); + time = rtc_tm_to_time64(tm); sec = readl(rtc->rtc_base + GEMINI_RTC_SECOND); min = readl(rtc->rtc_base + GEMINI_RTC_MINUTE);