[PATCH 25/51] rtc: ep93xx: stop using rtc deprecated functions
From: Benjamin Gaignard
Date: Tue Jun 20 2017 - 05:38:10 EST
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.
For the same reasons use set_mmss64 callback instead of set_mmss
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxx>
CC: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
CC: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx>
CC: rtc-linux@xxxxxxxxxxxxxxxx
CC: linux-kernel@xxxxxxxxxxxxxxx
---
drivers/rtc/rtc-ep93xx.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/rtc/rtc-ep93xx.c b/drivers/rtc/rtc-ep93xx.c
index 6940382..dcb71b2 100644
--- a/drivers/rtc/rtc-ep93xx.c
+++ b/drivers/rtc/rtc-ep93xx.c
@@ -59,15 +59,15 @@ static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload,
static int ep93xx_rtc_read_time(struct device *dev, struct rtc_time *tm)
{
struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev);
- unsigned long time;
+ unsigned long long time;
- time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA);
+ time = readl(ep93xx_rtc->mmio_base + EP93XX_RTC_DATA);
- rtc_time_to_tm(time, tm);
+ rtc_time64_to_tm(time, tm);
return 0;
}
-static int ep93xx_rtc_set_mmss(struct device *dev, unsigned long secs)
+static int ep93xx_rtc_set_mmss64(struct device *dev, time64_t secs)
{
struct ep93xx_rtc *ep93xx_rtc = dev_get_platdata(dev);
@@ -89,7 +89,7 @@ static int ep93xx_rtc_proc(struct device *dev, struct seq_file *seq)
static const struct rtc_class_ops ep93xx_rtc_ops = {
.read_time = ep93xx_rtc_read_time,
- .set_mmss = ep93xx_rtc_set_mmss,
+ .set_mmss64 = ep93xx_rtc_set_mmss64,
.proc = ep93xx_rtc_proc,
};
--
1.9.1