aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pps_kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pps_kernel.h')
-rw-r--r--include/linux/pps_kernel.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 54bf1484d41f..35ac903956c7 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -111,22 +111,17 @@ static inline void timespec_to_pps_ktime(struct pps_ktime *kt,
111 kt->nsec = ts.tv_nsec; 111 kt->nsec = ts.tv_nsec;
112} 112}
113 113
114#ifdef CONFIG_NTP_PPS
115
116static inline void pps_get_ts(struct pps_event_time *ts) 114static inline void pps_get_ts(struct pps_event_time *ts)
117{ 115{
118 ktime_get_raw_and_real_ts64(&ts->ts_raw, &ts->ts_real); 116 struct system_time_snapshot snap;
119}
120 117
121#else /* CONFIG_NTP_PPS */ 118 ktime_get_snapshot(&snap);
122 119 ts->ts_real = ktime_to_timespec64(snap.real);
123static inline void pps_get_ts(struct pps_event_time *ts) 120#ifdef CONFIG_NTP_PPS
124{ 121 ts->ts_raw = ktime_to_timespec64(snap.raw);
125 ktime_get_real_ts64(&ts->ts_real); 122#endif
126} 123}
127 124
128#endif /* CONFIG_NTP_PPS */
129
130/* Subtract known time delay from PPS event time(s) */ 125/* Subtract known time delay from PPS event time(s) */
131static inline void pps_sub_ts(struct pps_event_time *ts, struct timespec64 delta) 126static inline void pps_sub_ts(struct pps_event_time *ts, struct timespec64 delta)
132{ 127{