From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753204AbbDCITs (ORCPT ); Fri, 3 Apr 2015 04:19:48 -0400 Received: from terminus.zytor.com ([198.137.202.10]:44718 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753103AbbDCITp (ORCPT ); Fri, 3 Apr 2015 04:19:45 -0400 Date: Fri, 3 Apr 2015 01:19:05 -0700 From: tip-bot for Xunlei Pang Message-ID: Cc: peterz@infradead.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, pang.xunlei@linaro.org, mingo@kernel.org, john.stultz@linaro.org, a.zummo@towertech.it, hpa@zytor.com Reply-To: linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, a.zummo@towertech.it, hpa@zytor.com, pang.xunlei@linaro.org, mingo@kernel.org, john.stultz@linaro.org In-Reply-To: <1427945681-29972-14-git-send-email-john.stultz@linaro.org> References: <1427945681-29972-14-git-send-email-john.stultz@linaro.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:timers/core] drivers/rtc/mxc: Update driver to address y2038 /y2106 issues Git-Commit-ID: 933623c38f014b10db564f0ec44f9db64a5ced84 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 933623c38f014b10db564f0ec44f9db64a5ced84 Gitweb: http://git.kernel.org/tip/933623c38f014b10db564f0ec44f9db64a5ced84 Author: Xunlei Pang AuthorDate: Wed, 1 Apr 2015 20:34:33 -0700 Committer: Ingo Molnar CommitDate: Fri, 3 Apr 2015 08:18:29 +0200 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 Signed-off-by: John Stultz Acked-by: Alessandro Zummo Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1427945681-29972-14-git-send-email-john.stultz@linaro.org Signed-off-by: Ingo Molnar --- drivers/rtc/rtc-mxc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c index 83cba23..09d422b 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) /* * This function sets the internal RTC time based on tm in Gregorian date. */ -static int mxc_rtc_set_mmss(struct device *dev, unsigned long time) +static int mxc_rtc_set_mmss(struct device *dev, time64_t time) { struct platform_device *pdev = to_platform_device(dev); 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) if (is_imx1_rtc(pdata)) { struct rtc_time tm; - rtc_time_to_tm(time, &tm); + rtc_time64_to_tm(time, &tm); tm.tm_year = 70; - rtc_tm_to_time(&tm, &time); + time = rtc_tm_to_time64(&tm); } /* 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) static struct rtc_class_ops mxc_rtc_ops = { .release = mxc_rtc_release, .read_time = mxc_rtc_read_time, - .set_mmss = mxc_rtc_set_mmss, + .set_mmss64 = mxc_rtc_set_mmss, .read_alarm = mxc_rtc_read_alarm, .set_alarm = mxc_rtc_set_alarm, .alarm_irq_enable = mxc_rtc_alarm_irq_enable,