summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEusebio Gomez <eu_340@me.com>2018-06-14 18:54:48 -0400
committerJavier Martinez Canillas <javier@dowhile0.org>2018-06-20 14:59:05 +0200
commitbdf0647e57c8319cf5ce90375891c173b8f5d63f (patch)
tree14a376c73c2b8c9e023b552c218b012030db08b9
parent8b364ee2b4529522817113b0008e52af268fd555 (diff)
downloadldd3-master.tar.gz
Change in timer_list structHEADmaster
Member data of timer struct (timer_list) is no longer available. Use timer_setup function to pass the parameter to the callback function
-rw-r--r--tty/tiny_serial.c11
1 files changed, 8 insertions, 3 deletions
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 <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/module.h>
-
+#include <linux/version.h>
#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>"
#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;
}