From 2b2c7c9613f2d6910ca034eaf9b9eeede73ddfee Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Tue, 30 Jan 2018 17:09:33 +0100 Subject: [PATCH] Applied 0002-use-setup_timer-for-v4.15.patch from Beckhoff. --- examples/mini/mini.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/examples/mini/mini.c b/examples/mini/mini.c index 2f7bb535..f01934ae 100644 --- a/examples/mini/mini.c +++ b/examples/mini/mini.c @@ -307,7 +307,11 @@ void read_voe(void) /*****************************************************************************/ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) +void cyclic_task(struct timer_list *t) +#else void cyclic_task(unsigned long data) +#endif { // receive process data down(&master_sem); @@ -492,8 +496,12 @@ int __init init_mini_module(void) #endif printk(KERN_INFO PFX "Starting cyclic sample thread.\n"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) + timer_setup(&timer, cyclic_task, 0); +#else init_timer(&timer); timer.function = cyclic_task; +#endif timer.expires = jiffies + 10; add_timer(&timer);