From patchwork Tue Jun 20 09:35:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 9799045 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 8606360329 for ; Tue, 20 Jun 2017 09:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78E0326B41 for ; Tue, 20 Jun 2017 09:38:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BB71283A6; Tue, 20 Jun 2017 09:38:01 +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 C361826B41 for ; Tue, 20 Jun 2017 09:38:00 +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=FoBHHgR3PsNcU4lHsOTzmvsHlRytPfT7lJkA70gvBuU=; b=IteBz6kYodiT37NwsgrwDhiF/4 a0P+8ayqd9qABvAIzsx1Eab4UcSEcwRskxEf6bHGuKW4rhBGz3MbFgq16DBCYG1Hsx+G9THO2EYxG ZScQAABmzNktL3GuKmxZRX86gP5I459YYwkPpSxkmMOWt3lbsw6ZefvvYV/UlJZQol757bFRkgzlD dUxgBjTYnMg81gD45jBpqOADCsREgLOJDaSXyP5be3M1HS6lI0Yp+XNrIEvbt4QjiayBK1Cw7jlw0 Kb70RekoCTvF4RXk+K3XHISnRKzuPYtRpW7PxaDBkTIHZf/XFjdbs14wsWrxS/jYw7t/YFxhemPxr mVyohlgA==; 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 1dNFbj-00048R-2j; Tue, 20 Jun 2017 09:37:59 +0000 Received: from mail-wr0-x235.google.com ([2a00:1450:400c:c0c::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dNFbR-0003QQ-Gi for linux-arm-kernel@lists.infradead.org; Tue, 20 Jun 2017 09:37:45 +0000 Received: by mail-wr0-x235.google.com with SMTP id c11so32943820wrc.3 for ; Tue, 20 Jun 2017 02:37:21 -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=7eiQxVPR0aLE6Chuup7XrCyjO/ZhueZeXLvfojlzPak=; b=ROHdEQ1QhMuKMO8aP/zBxTOnNWpyQsUAi2eAqGRS2WwZuEjaNbWOYdVnWa9BWd9b45 adqwWPjTW1ST+F7fLvkyUWUic3okxSZ4JP801NqvdPsq3ho6/GcTJEwH/WCfD3eiHRgj gwAH2fEBeODcNM5dgmH97ImSU8k1yFgZOtqrQ= 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=7eiQxVPR0aLE6Chuup7XrCyjO/ZhueZeXLvfojlzPak=; b=tW7TscdWCaNG+YWJYqsPZaiQo+hHTK5LnmmRorJylu02b4cYMJl4vYKeb//Fr3IyFM yNtSquphRyJ/IYl+hL9iKv9suW7pIT3rZ6DSSKTVBB6L+w5QSPlD23xZlzLAGHP4ZUxQ eawbdGPcZSroWCb90815CWd+kjMiF2zpkG8Z1X9Ns/SKtJSQgiixkznuiAL+ayZv2f8G N+Z4i0F5Stof3owDsZlT1GEOnQPHnObJy0c1jqwnb46ZrGkKtjoUM0ct04wfJ3s0hWXd 6RezjH9j1pLLfYzOG3vOjTPYvLMatXml9m2X2x5qbdEesN09E+6UqoBNUY/Ki+z6A0hd 2tZQ== X-Gm-Message-State: AKS2vOwapMuHn/PY+V5N7tTIeGUhVL/wErL5NYwfryiKI0t0LajkI+D9 zc+E371yHCWiFhDp X-Received: by 10.223.176.164 with SMTP id i33mr18064593wra.165.1497951439682; Tue, 20 Jun 2017 02:37:19 -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.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 02:37:19 -0700 (PDT) From: Benjamin Gaignard To: benjamin.gaignard@linaro.org Subject: [PATCH 12/51] rtc: coh901331: stop using rtc deprecated functions Date: Tue, 20 Jun 2017 11:35:20 +0200 Message-Id: <1497951359-13334-13-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_023742_112986_5D129094 X-CRM114-Status: GOOD ( 13.08 ) 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, Linus Walleij , 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: Linus Walleij CC: Alessandro Zummo CC: Alexandre Belloni CC: rtc-linux@googlegroups.com CC: linux-kernel@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org Acked-by: Linus Walleij --- drivers/rtc/rtc-coh901331.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-coh901331.c b/drivers/rtc/rtc-coh901331.c index cfc4141..5645011 100644 --- a/drivers/rtc/rtc-coh901331.c +++ b/drivers/rtc/rtc-coh901331.c @@ -80,7 +80,8 @@ static int coh901331_read_time(struct device *dev, struct rtc_time *tm) clk_enable(rtap->clk); /* Check if the time is valid */ if (readl(rtap->virtbase + COH901331_VALID)) { - rtc_time_to_tm(readl(rtap->virtbase + COH901331_CUR_TIME), tm); + rtc_time64_to_tm( + (u64)readl(rtap->virtbase + COH901331_CUR_TIME), tm); clk_disable(rtap->clk); return rtc_valid_tm(tm); } @@ -88,7 +89,7 @@ static int coh901331_read_time(struct device *dev, struct rtc_time *tm) return -EINVAL; } -static int coh901331_set_mmss(struct device *dev, unsigned long secs) +static int coh901331_set_mmss64(struct device *dev, time64_t secs) { struct coh901331_port *rtap = dev_get_drvdata(dev); @@ -104,7 +105,8 @@ static int coh901331_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) struct coh901331_port *rtap = dev_get_drvdata(dev); clk_enable(rtap->clk); - rtc_time_to_tm(readl(rtap->virtbase + COH901331_ALARM), &alarm->time); + rtc_time64_to_tm( + (u64)readl(rtap->virtbase + COH901331_ALARM), &alarm->time); alarm->pending = readl(rtap->virtbase + COH901331_IRQ_EVENT) & 1U; alarm->enabled = readl(rtap->virtbase + COH901331_IRQ_MASK) & 1U; clk_disable(rtap->clk); @@ -115,9 +117,9 @@ static int coh901331_read_alarm(struct device *dev, struct rtc_wkalrm *alarm) static int coh901331_set_alarm(struct device *dev, struct rtc_wkalrm *alarm) { struct coh901331_port *rtap = dev_get_drvdata(dev); - unsigned long time; + unsigned long long time; - rtc_tm_to_time(&alarm->time, &time); + time = rtc_tm_to_time64(&alarm->time); clk_enable(rtap->clk); writel(time, rtap->virtbase + COH901331_ALARM); writel(alarm->enabled, rtap->virtbase + COH901331_IRQ_MASK); @@ -142,7 +144,7 @@ static int coh901331_alarm_irq_enable(struct device *dev, unsigned int enabled) static const struct rtc_class_ops coh901331_ops = { .read_time = coh901331_read_time, - .set_mmss = coh901331_set_mmss, + .set_mmss64 = coh901331_set_mmss64, .read_alarm = coh901331_read_alarm, .set_alarm = coh901331_set_alarm, .alarm_irq_enable = coh901331_alarm_irq_enable,