qcacmn: rtc_time64_to_tm support for 4.0+ kernel
rtc_time64_to_tm in defined from kernel 4.0+. Use rtc_time64_to_tm instead of rtc_time_to_tm from kernel 4.0+. Change-Id: I6335150300cd4cd7a91d771dd86bf11592d1ff11 CRs-Fixed: 2666521
This commit is contained in:
@@ -852,7 +852,7 @@ s64 qdf_get_monotonic_boottime_ns(void)
|
||||
}
|
||||
qdf_export_symbol(qdf_get_monotonic_boottime_ns);
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
|
||||
qdf_time_t qdf_get_time_of_the_day_ms(void)
|
||||
{
|
||||
struct timespec64 tv;
|
||||
@@ -861,12 +861,13 @@ qdf_time_t qdf_get_time_of_the_day_ms(void)
|
||||
|
||||
ktime_get_real_ts64(&tv);
|
||||
local_time = (qdf_time_t)(tv.tv_sec - (sys_tz.tz_minuteswest * 60));
|
||||
rtc_time_to_tm(local_time, &tm);
|
||||
rtc_time64_to_tm(local_time, &tm);
|
||||
|
||||
return (tm.tm_hour * 60 * 60 * 1000) +
|
||||
(tm.tm_min * 60 * 1000) + (tm.tm_sec * 1000) +
|
||||
(tv.tv_nsec / 1000000);
|
||||
}
|
||||
|
||||
qdf_export_symbol(qdf_get_time_of_the_day_ms);
|
||||
|
||||
#else
|
||||
@@ -901,7 +902,7 @@ void qdf_timer_module_deinit(void)
|
||||
}
|
||||
qdf_export_symbol(qdf_timer_module_deinit);
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0))
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0))
|
||||
void qdf_get_time_of_the_day_in_hr_min_sec_usec(char *tbuf, int len)
|
||||
{
|
||||
struct timespec64 tv;
|
||||
@@ -912,11 +913,12 @@ void qdf_get_time_of_the_day_in_hr_min_sec_usec(char *tbuf, int len)
|
||||
ktime_get_real_ts64(&tv);
|
||||
/* Convert rtc to local time */
|
||||
local_time = (u32)(tv.tv_sec - (sys_tz.tz_minuteswest * 60));
|
||||
rtc_time_to_tm(local_time, &tm);
|
||||
rtc_time64_to_tm(local_time, &tm);
|
||||
scnprintf(tbuf, len,
|
||||
"[%02d:%02d:%02d.%06lu]",
|
||||
tm.tm_hour, tm.tm_min, tm.tm_sec, tv.tv_nsec / 1000);
|
||||
}
|
||||
|
||||
qdf_export_symbol(qdf_get_time_of_the_day_in_hr_min_sec_usec);
|
||||
|
||||
#else
|
||||
|
Fai riferimento in un nuovo problema
Block a user