summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/systohc.c
diff options
context:
space:
mode:
authorXunlei Pang <pang.xunlei@linaro.org>2015-04-02 05:34:27 +0200
committerIngo Molnar <mingo@kernel.org>2015-04-03 08:18:24 +0200
commit8e4ff1a81aa91d12856287c7103d0301ac91351a (patch)
treecf42bb0295c0e6accd4453645573fa625c3e64ce /drivers/rtc/systohc.c
parentARM, clocksource/drivers: Provide read_boot_clock64() and read_persistent_clo... (diff)
downloadlinux-8e4ff1a81aa91d12856287c7103d0301ac91351a.tar.xz
linux-8e4ff1a81aa91d12856287c7103d0301ac91351a.zip
drivers/rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement
Currently the rtc_class_op's set_mmss() function takes a 32-bit second value (on 32-bit systems), which is problematic for dates past y2038. This patch provides a safe version named set_mmss64() using y2038 safe time64_t. After this patch, set_mmss() is deprecated and all its users will be fixed to use set_mmss64(), it can be removed when having no users. Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org> [jstultz: Add whitespace fix for checkpatch] 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-8-git-send-email-john.stultz@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/rtc/systohc.c')
-rw-r--r--drivers/rtc/systohc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/rtc/systohc.c b/drivers/rtc/systohc.c
index ef3c07a52c3a..7728d5e32bf4 100644
--- a/drivers/rtc/systohc.c
+++ b/drivers/rtc/systohc.c
@@ -35,7 +35,10 @@ int rtc_set_ntp_time(struct timespec64 now)
if (rtc) {
/* rtc_hctosys exclusively uses UTC, so we call set_time here,
* not set_mmss. */
- if (rtc->ops && (rtc->ops->set_time || rtc->ops->set_mmss))
+ if (rtc->ops &&
+ (rtc->ops->set_time ||
+ rtc->ops->set_mmss64 ||
+ rtc->ops->set_mmss))
err = rtc_set_time(rtc, &tm);
rtc_class_close(rtc);
}