author | Liang Ji <liang.ji@amlogic.com> | 2020-03-19 08:35:22 (GMT) |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2020-03-20 01:56:59 (GMT) |
commit | cb560ce12843aec1ef4012b3e82de03405259eb3 (patch) | |
tree | 32f6a1005f1944ba25f411fd608ff69ca077f915 | |
parent | 3e834fce088a9f1145f8d2ee5db674ddd398032a (diff) | |
download | tdk_linuxdriver-sabrina.zip tdk_linuxdriver-sabrina.tar.gz tdk_linuxdriver-sabrina.tar.bz2 |
log: kernel4.19 compile error [1/1]
PD#SWPL-9652
BUG=150429619
Comment:
this CL do not fix the problem 150429619
but it will show more useful ta debug info logs when problem occur again
and it will be helpful for future work and maintenance
Problem:
init_timer() function not exist in kernel4.19
Solution:
1) use setup_timer() to init timer in kernel4.9
2) use timer_setup() to init timer in kernel4.19
Verify:
Sabrina
Change-Id: Ie9e12494a9b16eb6432a01cf8b503bae4c019023
Signed-off-by: Liqiang Jin <liqiang.jin@amlogic.com>
-rw-r--r-- | optee/log.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/optee/log.c b/optee/log.c index 45f0373..bac6ae0 100644 --- a/optee/log.c +++ b/optee/log.c @@ -20,6 +20,7 @@ #include <linux/uaccess.h> #include <linux/sysfs.h> #include <linux/kthread.h> +#include <generated/uapi/linux/version.h> #include "optee_smc.h" #include "optee_private.h" @@ -269,7 +270,11 @@ static void log_buff_output(void) log_print_text(read_buff, len); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 34) +static void log_timer_func(struct timer_list *timer) +#else static void log_timer_func(unsigned long arg) +#endif { log_buff_output(); mod_timer(&optee_log_timer, jiffies + OPTEE_LOG_TIMER_INTERVAL * HZ); @@ -306,9 +311,11 @@ int optee_log_init(struct tee_device *tee_dev, phys_addr_t shm_pa, } /* init timer */ - init_timer(&optee_log_timer); - optee_log_timer.data = 0L; - optee_log_timer.function = log_timer_func; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 34) + timer_setup(&optee_log_timer, log_timer_func, 0); +#else + setup_timer(&optee_log_timer, log_timer_func, 0); +#endif optee_log_timer.expires = jiffies + HZ; add_timer(&optee_log_timer); |