# HG changeset patch # User Florian Pose # Date 1517328573 -3600 # Node ID 2b072c95b34c01056cf67f4abcfa3cef5215b254 # Parent ad58465e75ca30988aeac451b1395d1fb73e9284 Applied 0002-use-setup_timer-for-v4.15.patch from Beckhoff. diff -r ad58465e75ca -r 2b072c95b34c examples/mini/mini.c --- a/examples/mini/mini.c Tue Jan 30 17:08:21 2018 +0100 +++ b/examples/mini/mini.c Tue Jan 30 17:09:33 2018 +0100 @@ -307,7 +307,11 @@ /*****************************************************************************/ +#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 @@ #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);