aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorXunlei Pang <pang.xunlei@linaro.org>2015-04-01 23:34:33 -0400
committerIngo Molnar <mingo@kernel.org>2015-04-03 02:18:29 -0400
commit933623c38f014b10db564f0ec44f9db64a5ced84 (patch)
tree261e97d1803cfb7614fc70d122461d95a85416e1 /drivers/rtc
parenta015b8aabfd2fb58875dea001f1eac8100eacc2e (diff)
drivers/rtc/mxc: Update driver to address y2038/y2106 issues
This driver has a number of y2038/y2106 issues. This patch resolves them by: - Replacing rtc_time_to_tm() with rtc_time64_to_tm() - Replacing rtc_tm_to_time() with rtc_tm_to_time64() - Changing mxc_rtc_set_mmss() to use rtc_class_ops's set_mmss64() After this patch, the driver should not have any remaining y2038/y2106 issues. Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1427945681-29972-14-git-send-email-john.stultz@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-mxc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 83cba23a6b00..09d422b9f7f7 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -286,7 +286,7 @@ static int mxc_rtc_read_time(struct device *dev, struct rtc_time *tm)
286/* 286/*
287 * This function sets the internal RTC time based on tm in Gregorian date. 287 * This function sets the internal RTC time based on tm in Gregorian date.
288 */ 288 */
289static int mxc_rtc_set_mmss(struct device *dev, unsigned long time) 289static int mxc_rtc_set_mmss(struct device *dev, time64_t time)
290{ 290{
291 struct platform_device *pdev = to_platform_device(dev); 291 struct platform_device *pdev = to_platform_device(dev);
292 struct rtc_plat_data *pdata = platform_get_drvdata(pdev); 292 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
@@ -297,9 +297,9 @@ static int mxc_rtc_set_mmss(struct device *dev, unsigned long time)
297 if (is_imx1_rtc(pdata)) { 297 if (is_imx1_rtc(pdata)) {
298 struct rtc_time tm; 298 struct rtc_time tm;
299 299
300 rtc_time_to_tm(time, &tm); 300 rtc_time64_to_tm(time, &tm);
301 tm.tm_year = 70; 301 tm.tm_year = 70;
302 rtc_tm_to_time(&tm, &time); 302 time = rtc_tm_to_time64(&tm);
303 } 303 }
304 304
305 /* Avoid roll-over from reading the different registers */ 305 /* Avoid roll-over from reading the different registers */
@@ -347,7 +347,7 @@ static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
347static struct rtc_class_ops mxc_rtc_ops = { 347static struct rtc_class_ops mxc_rtc_ops = {
348 .release = mxc_rtc_release, 348 .release = mxc_rtc_release,
349 .read_time = mxc_rtc_read_time, 349 .read_time = mxc_rtc_read_time,
350 .set_mmss = mxc_rtc_set_mmss, 350 .set_mmss64 = mxc_rtc_set_mmss,
351 .read_alarm = mxc_rtc_read_alarm, 351 .read_alarm = mxc_rtc_read_alarm,
352 .set_alarm = mxc_rtc_set_alarm, 352 .set_alarm = mxc_rtc_set_alarm,
353 .alarm_irq_enable = mxc_rtc_alarm_irq_enable, 353 .alarm_irq_enable = mxc_rtc_alarm_irq_enable,