diff options
-rw-r--r-- | include/linux/timekeeping.h | 13 | ||||
-rw-r--r-- | kernel/time/timekeeping.c | 10 |
2 files changed, 16 insertions, 7 deletions
diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index 071ad7e0c981..6d76c6502892 100644 --- a/include/linux/timekeeping.h +++ b/include/linux/timekeeping.h | |||
@@ -201,7 +201,18 @@ static inline void timekeeping_clocktai(struct timespec *ts) | |||
201 | /* | 201 | /* |
202 | * RTC specific | 202 | * RTC specific |
203 | */ | 203 | */ |
204 | extern void timekeeping_inject_sleeptime(struct timespec *delta); | 204 | extern void timekeeping_inject_sleeptime64(struct timespec64 *delta); |
205 | |||
206 | /** | ||
207 | * Deprecated. Use timekeeping_inject_sleeptime64(). | ||
208 | */ | ||
209 | static inline void timekeeping_inject_sleeptime(struct timespec *delta) | ||
210 | { | ||
211 | struct timespec64 delta64; | ||
212 | |||
213 | delta64 = timespec_to_timespec64(*delta); | ||
214 | timekeeping_inject_sleeptime64(&delta64); | ||
215 | } | ||
205 | 216 | ||
206 | /* | 217 | /* |
207 | * PPS accessor | 218 | * PPS accessor |
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 10140dae71c6..2bde974437fd 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1067,8 +1067,8 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk, | |||
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | /** | 1069 | /** |
1070 | * timekeeping_inject_sleeptime - Adds suspend interval to timeekeeping values | 1070 | * timekeeping_inject_sleeptime64 - Adds suspend interval to timeekeeping values |
1071 | * @delta: pointer to a timespec delta value | 1071 | * @delta: pointer to a timespec64 delta value |
1072 | * | 1072 | * |
1073 | * This hook is for architectures that cannot support read_persistent_clock | 1073 | * This hook is for architectures that cannot support read_persistent_clock |
1074 | * because their RTC/persistent clock is only accessible when irqs are enabled. | 1074 | * because their RTC/persistent clock is only accessible when irqs are enabled. |
@@ -1076,10 +1076,9 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk, | |||
1076 | * This function should only be called by rtc_resume(), and allows | 1076 | * This function should only be called by rtc_resume(), and allows |
1077 | * a suspend offset to be injected into the timekeeping values. | 1077 | * a suspend offset to be injected into the timekeeping values. |
1078 | */ | 1078 | */ |
1079 | void timekeeping_inject_sleeptime(struct timespec *delta) | 1079 | void timekeeping_inject_sleeptime64(struct timespec64 *delta) |
1080 | { | 1080 | { |
1081 | struct timekeeper *tk = &tk_core.timekeeper; | 1081 | struct timekeeper *tk = &tk_core.timekeeper; |
1082 | struct timespec64 tmp; | ||
1083 | unsigned long flags; | 1082 | unsigned long flags; |
1084 | 1083 | ||
1085 | /* | 1084 | /* |
@@ -1094,8 +1093,7 @@ void timekeeping_inject_sleeptime(struct timespec *delta) | |||
1094 | 1093 | ||
1095 | timekeeping_forward_now(tk); | 1094 | timekeeping_forward_now(tk); |
1096 | 1095 | ||
1097 | tmp = timespec_to_timespec64(*delta); | 1096 | __timekeeping_inject_sleeptime(tk, delta); |
1098 | __timekeeping_inject_sleeptime(tk, &tmp); | ||
1099 | 1097 | ||
1100 | timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET); | 1098 | timekeeping_update(tk, TK_CLEAR_NTP | TK_MIRROR | TK_CLOCK_WAS_SET); |
1101 | 1099 | ||