[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1499846682-14093-8-git-send-email-benjamin.gaignard@linaro.org>
Date: Wed, 12 Jul 2017 10:04:27 +0200
From: Benjamin Gaignard <benjamin.gaignard@...aro.org>
To: benjamin.gaignard@...aro.org
Cc: linaro-kernel@...ts.linaro.org,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org
Subject: [PATCH v2 07/22] rtc: davinci: stop using rtc deprecated functions
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 <benjamin.gaignard@...aro.org>
CC: Alessandro Zummo <a.zummo@...ertech.it>
CC: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
CC: rtc-linux@...glegroups.com
CC: linux-kernel@...r.kernel.org
---
drivers/rtc/rtc-davinci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
index caf3556..03beba3 100644
--- a/drivers/rtc/rtc-davinci.c
+++ b/drivers/rtc/rtc-davinci.c
@@ -429,18 +429,18 @@ static int davinci_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm)
if (alm->time.tm_mday <= 0 && alm->time.tm_mon < 0
&& alm->time.tm_year < 0) {
struct rtc_time tm;
- unsigned long now, then;
+ unsigned long long now, then;
davinci_rtc_read_time(dev, &tm);
- rtc_tm_to_time(&tm, &now);
+ now = rtc_tm_to_time64(&tm);
alm->time.tm_mday = tm.tm_mday;
alm->time.tm_mon = tm.tm_mon;
alm->time.tm_year = tm.tm_year;
- rtc_tm_to_time(&alm->time, &then);
+ then = rtc_tm_to_time64(&alm->time);
if (then < now) {
- rtc_time_to_tm(now + 24 * 60 * 60, &tm);
+ rtc_time64_to_tm(now + 24 * 60 * 60, &tm);
alm->time.tm_mday = tm.tm_mday;
alm->time.tm_mon = tm.tm_mon;
alm->time.tm_year = tm.tm_year;
--
1.9.1
Powered by blists - more mailing lists