diff options
author | John Klug <john.klug@multitech.com> | 2019-07-24 16:44:35 -0500 |
---|---|---|
committer | Volodymyr Vorobiov <volodymyr.vorobiov@globallogic.com> | 2020-02-12 12:29:46 +0200 |
commit | ce0d4983a61b0fed699bf67cf4c1f6472cc92d87 (patch) | |
tree | 9738ae12beba45b4cb49c03378f888a71ea85bed | |
parent | ef4704339401e54e8dcfec173d270ffbf2f1007e (diff) | |
download | mts-io-ce0d4983a61b0fed699bf67cf4c1f6472cc92d87.tar.gz mts-io-ce0d4983a61b0fed699bf67cf4c1f6472cc92d87.tar.bz2 mts-io-ce0d4983a61b0fed699bf67cf4c1f6472cc92d87.zip |
New 4.19 kernel replaced setup_timer with timer_setup
(cherry picked from commit a0c2b0390d8a92d89fcda252f9e09275446d01dd)
-rw-r--r-- | io-module/mts-io.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/io-module/mts-io.c b/io-module/mts-io.c index 8c35f74..66ded86 100644 --- a/io-module/mts-io.c +++ b/io-module/mts-io.c @@ -135,8 +135,8 @@ static volatile int radio_reset_timer_is_start = 0; static struct timer_list radio_reset_available_timer; static volatile int radio_reset_available_timer_is_start = 0; static time_t time_now_secs(void); -static void radio_reset_available_timer_callback(unsigned long data); -static void radio_reset_timer_callback(unsigned long data); +static void radio_reset_available_timer_callback(struct timer_list *list); +static void radio_reset_timer_callback(struct timer_list *list); /* generic GPIO support */ #include "gpio.c" @@ -283,7 +283,7 @@ static time_t time_now_secs(void) return ts.tv_sec; } -static void radio_reset_available_timer_callback( unsigned long data ) +static void radio_reset_available_timer_callback( struct timer_list *data ) { /* do your timer stuff here */ //log_info("radio_reset_available_timer_callback\n"); @@ -295,7 +295,7 @@ static void radio_reset_available_timer_callback( unsigned long data ) radio_reset_available_timer_is_start = 0; } -static void radio_reset_timer_callback( unsigned long data ) +static void radio_reset_timer_callback( struct timer_list *data ) { /* do your timer stuff here */ //log_info("radio_reset_timer_callback\n"); @@ -1020,9 +1020,13 @@ static int __init mts_io_init(void) init_buttons(); /* init timers */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) + timer_setup(&radio_reset_timer, radio_reset_timer_callback, 0); + timer_setup(&radio_reset_available_timer, radio_reset_available_timer_callback, 0); +#else setup_timer(&radio_reset_timer, radio_reset_timer_callback, 0); setup_timer(&radio_reset_available_timer, radio_reset_available_timer_callback, 0); - +#endif return 0; } |