From bdf0647e57c8319cf5ce90375891c173b8f5d63f Mon Sep 17 00:00:00 2001 From: Eusebio Gomez Date: Thu, 14 Jun 2018 18:54:48 -0400 Subject: Change in timer_list struct Member data of timer struct (timer_list) is no longer available. Use timer_setup function to pass the parameter to the callback function --- tty/tiny_serial.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'tty/tiny_serial.c') diff --git a/tty/tiny_serial.c b/tty/tiny_serial.c index 4fda428..e81defe 100644 --- a/tty/tiny_serial.c +++ b/tty/tiny_serial.c @@ -21,7 +21,7 @@ #include #include #include - +#include #define DRIVER_AUTHOR "Greg Kroah-Hartman " #define DRIVER_DESC "Tiny serial driver" @@ -202,9 +202,14 @@ static int tiny_startup(struct uart_port *port) if (!timer) return -ENOMEM; } - timer->data = (unsigned long)port; + #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) + timer->data = (unsigned long)port; + timer->function = tiny_timer; + #else + timer_setup(timer, (void *) tiny_timer, (unsigned long) port); + timer->function = (void *) tiny_timer; + #endif timer->expires = jiffies + DELAY_TIME; - timer->function = tiny_timer; add_timer(timer); return 0; } -- cgit v1.2.1-18-gbd029