blob: 154bb673ece4fc8a48804e12f22db0f565ef4e37 [file] [log] [blame]
Andrew Geissler84ad7c52020-06-27 00:00:16 -05001From c6a6b39cea3fdfd91cae7f2a4ef6f36d2c55fdd6 Mon Sep 17 00:00:00 2001
2From: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
3Date: Tue, 25 Feb 2020 15:17:17 -0800
4Subject: [LINUX][rel-v2020.1][PATCH v1] "get_monotonic_boottime(&ts)"
5 deprecated from kernel 4.20 onwards
6
7As "get_monotonic_boottime(&ts)" is deprecated, replace the same with
8"ktime_get_boottime_ts64(&ts)". Refer kernel commit ID
9976516404ff3fab2a8caa8bd6f5efc1437fed0b8
10
11Signed-off-by: Madhurkiran Harikrishnan <madhurkiran.harikrishnan@xilinx.com>
12---
13 driver/src/devicedrv/mali/linux/mali_osk_time.c | 6 ++++++
14 1 file changed, 6 insertions(+)
15
16diff --git a/driver/src/devicedrv/mali/linux/mali_osk_time.c b/driver/src/devicedrv/mali/linux/mali_osk_time.c
17index 03046a5..bfcbf7f 100644
18--- linux/mali_osk_time.c
19+++ b/linux/mali_osk_time.c
20@@ -53,7 +53,13 @@ u64 _mali_osk_time_get_ns(void)
21
22 u64 _mali_osk_boot_time_get_ns(void)
23 {
24+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
25+ struct timespec64 tsval;
26+ ktime_get_boottime_ts64(&tsval);
27+ return (u64)timespec64_to_ns(&tsval);
28+#else
29 struct timespec tsval;
30 get_monotonic_boottime(&tsval);
31 return (u64)timespec_to_ns(&tsval);
32+#endif
33 }
34--
352.7.4
36