diff options
author | Xunlei Pang <pang.xunlei@linaro.org> | 2015-01-21 21:31:55 -0500 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2015-01-23 20:21:57 -0500 |
commit | 9a4a445e30f0b601ca2d9433274047cbf48ebf9e (patch) | |
tree | b02b62d1598b6a84332d527ec7e9ba996948d084 /drivers/rtc/systohc.c | |
parent | 966301a23ef8ff0a4c5f71b585dafbf334808574 (diff) |
rtc: Convert rtc_set_ntp_time() to use timespec64
rtc_set_ntp_time() uses timespec which is y2038-unsafe,
so modify to use timespec64 which is y2038-safe, then
replace rtc_time_to_tm() with rtc_time64_to_tm().
Also adjust all its call sites(only NTP uses it) accordingly.
Cc: pang.xunlei <pang.xunlei@linaro.org>
Cc: Arnd Bergmann <arnd.bergmann@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'drivers/rtc/systohc.c')
-rw-r--r-- | drivers/rtc/systohc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rtc/systohc.c b/drivers/rtc/systohc.c index bf3e242ccc5c..eb71872d0361 100644 --- a/drivers/rtc/systohc.c +++ b/drivers/rtc/systohc.c | |||
@@ -20,16 +20,16 @@ | |||
20 | * | 20 | * |
21 | * If temporary failure is indicated the caller should try again 'soon' | 21 | * If temporary failure is indicated the caller should try again 'soon' |
22 | */ | 22 | */ |
23 | int rtc_set_ntp_time(struct timespec now) | 23 | int rtc_set_ntp_time(struct timespec64 now) |
24 | { | 24 | { |
25 | struct rtc_device *rtc; | 25 | struct rtc_device *rtc; |
26 | struct rtc_time tm; | 26 | struct rtc_time tm; |
27 | int err = -ENODEV; | 27 | int err = -ENODEV; |
28 | 28 | ||
29 | if (now.tv_nsec < (NSEC_PER_SEC >> 1)) | 29 | if (now.tv_nsec < (NSEC_PER_SEC >> 1)) |
30 | rtc_time_to_tm(now.tv_sec, &tm); | 30 | rtc_time64_to_tm(now.tv_sec, &tm); |
31 | else | 31 | else |
32 | rtc_time_to_tm(now.tv_sec + 1, &tm); | 32 | rtc_time64_to_tm(now.tv_sec + 1, &tm); |
33 | 33 | ||
34 | rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); | 34 | rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE); |
35 | if (rtc) { | 35 | if (rtc) { |