backport-include: backport ktime_get_boottime_seconds
[openwrt/staging/blogic.git] / backport / backport-include / linux / timekeeping.h
index 30f9b7a96f4ab3a2f5dc0564b323f27c370f6e15..56c3deecdea7c3414a0edd545d3cb020864aba70 100644 (file)
@@ -24,6 +24,13 @@ static inline u64 ktime_get_boot_ns(void)
 }
 #endif /* < 3.17 */
 
+#if LINUX_VERSION_IS_LESS(4,18,0)
+static inline time64_t ktime_get_boottime_seconds(void)
+{
+       return ktime_divns(ktime_get_boottime(), NSEC_PER_SEC);
+}
+#endif /* < 4.18 */
+
 #if LINUX_VERSION_IS_LESS(3,19,0)
 static inline time64_t ktime_get_seconds(void)
 {