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: 105983 Delivered-To: patch@linaro.org Received: by 10.140.91.2 with SMTP id y2csp1279891qgd; Tue, 20 Jun 2017 02:54:02 -0700 (PDT) X-Received: by 10.84.176.3 with SMTP id u3mr2258plb.134.1497952442842; Tue, 20 Jun 2017 02:54:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497952442; cv=none; d=google.com; s=arc-20160816; b=n4Q0cOhanuKkIp6nSwWVq87L2U+S3XhmPwDeFPvjScxAAELv9iJNygf4IQU930S464 BcmlL2I8ukj2j5UTgh8zZEaao3CspkmzzOKBxvY0sTcoNJ74kgRFckID+0T+qy5Dvj3g GVC89zNtRVqzLS0NwbYnneKOq7nguTgDzjE/BLL0eePfm+QwyEmw2yz+qLvCmgFloIeM 1Q9bCYm71DX7jjtNMjADjDYBigzz+bevqde5z1+z8jPeYKsWae/WWKCGQoDIrruBfz6h V+cStLFyvrkTgd83HWrVDqrRP+GtZp1yx+Dyej7f/DsRWBBFy4NiriymDHP651XJKIL/ 5L8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=7eiQxVPR0aLE6Chuup7XrCyjO/ZhueZeXLvfojlzPak=; b=kUrAui372AQNf48x77mIzm7+f6iB9VrEbPNTAWTt2u7Vl3o/qsjQRApHfLEXfN4Deo FU0r3DJxPn6w9pjrPQ+liRTQIJoVXek2IG4yIskUQifdW2vgJ+7RIzc9UnLBfFSeSwU2 Re1T5S7ThIEMAX0KlFkXdVlAQ1w2NrIAmtWkKUdZqxMhJKAZou8Xud6E+i9Js4u7N2QY PUM/WRrMDQ+I0gOarO94UtxrGlkXXo0+lKaGCcizLvCruxYRfdSvpTk/QBqQl2egxV+O VKZF/ry6cnlqA1aKdPdhltV7+6ltZ8yYdb0BnBcdxb9+WfoQEecon6rW1IQEDJlgS6Kn ByqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=ROHdEQ1Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p28si6367357pli.166.2017.06.20.02.54.02; Tue, 20 Jun 2017 02:54:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.b=ROHdEQ1Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752795AbdFTJhf (ORCPT + 25 others); Tue, 20 Jun 2017 05:37:35 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:33933 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752103AbdFTJhb (ORCPT ); Tue, 20 Jun 2017 05:37:31 -0400 Received: by mail-wr0-f173.google.com with SMTP id 77so88366171wrb.1 for ; Tue, 20 Jun 2017 02:37:25 -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=ZUbO/XmX5FlxjXN0ZvxQqRsFk43VyufZEHvluxn11zp2iONmC5op+wC19Cr7WcwBl6 MgIorthVW2SvJGyMijAokmXhry9EYXv/PbAdvzJnHShxqz4mhQ11zkgHvl/9kQnH4zDD dk5hHG03PQ/cbY3ehjJ5dFCSjru0UdboSwaMqCrofV5JF7W2vNgWNPUKJkSlNjPKi3w3 sLVwGxOwNu/bprNNtwb5u7Xpjt4KyNrjHUtK6jmUR7l45b9DyP2flAyWcP3h/8xNNH7d 6riJfK4MF8Z1UtVNw3wRSZmzhbhZA2XmZr9MStsulduGZY/oiHktKaNwYLWQQH69uuEO YPCg== X-Gm-Message-State: AKS2vOxGkuaeIc5MYfWIzBPXouWcjmMqgzZPa1NJBT7QESEsIb7ixqHB cGwbIExI5uVEoNxV 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 Cc: linaro-kernel@lists.linaro.org, Linus Walleij , Alessandro Zummo , Alexandre Belloni , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/rtc/rtc-coh901331.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) -- 1.9.1 Acked-by: Linus Walleij 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,