summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--io-module/mts-io.c14
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;
}