diff mbox series

[03/12] header: Add ktime_get_boottime_ns()

Message ID 20190805120704.13128-4-hauke@hauke-m.de (mailing list archive)
State Accepted
Headers show
Series backports: Update to kernel 5.3-rc3 | expand

Commit Message

Hauke Mehrtens Aug. 5, 2019, 12:06 p.m. UTC
ktime_get_boottime_ns() was added in commit 9285ec4c8b61 ("timekeeping:
Use proper clock specifier names in functions") in kernel 5.3. This is
used by multiple drivers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/timekeeping.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/timekeeping.h b/backport/backport-include/linux/timekeeping.h
index 71871531..25ceaf3e 100644
--- a/backport/backport-include/linux/timekeeping.h
+++ b/backport/backport-include/linux/timekeeping.h
@@ -17,11 +17,17 @@  static inline u64 ktime_get_ns(void)
 }
 
 extern ktime_t ktime_get_boottime(void);
-#define ktime_get_boot_ns LINUX_BACKPORT(ktime_get_boot_ns)
-static inline u64 ktime_get_boot_ns(void)
+#define ktime_get_boottime_ns LINUX_BACKPORT(ktime_get_boottime_ns)
+static inline u64 ktime_get_boottime_ns(void)
 {
 	return ktime_to_ns(ktime_get_boottime());
 }
+#elif LINUX_VERSION_IS_LESS(5,3,0)
+#define ktime_get_boottime_ns LINUX_BACKPORT(ktime_get_boottime_ns)
+static inline u64 ktime_get_boottime_ns(void)
+{
+	return ktime_get_boot_ns();
+}
 #endif /* < 3.17 */
 
 #if LINUX_VERSION_IS_LESS(4,18,0)