File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11
11
#include <linux/module.h> /* Specifically, a module */
12
12
#include <linux/printk.h>
13
13
#include <linux/types.h>
14
+ #include <linux/uaccess.h> /* for get_user and put_user */
14
15
15
16
#include <asm/errno.h>
16
17
Original file line number Diff line number Diff line change 7
7
#include <linux/kthread.h>
8
8
#include <linux/module.h>
9
9
#include <linux/printk.h>
10
+ #include <linux/version.h>
10
11
11
12
static struct {
12
13
struct completion crank_comp ;
@@ -18,7 +19,11 @@ static int machine_crank_thread(void *arg)
18
19
pr_info ("Turn the crank\n" );
19
20
20
21
complete_all (& machine .crank_comp );
22
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (5 , 17 , 0 )
23
+ kthread_complete_and_exit (& machine .crank_comp , 0 );
24
+ #else
21
25
complete_and_exit (& machine .crank_comp , 0 );
26
+ #endif
22
27
}
23
28
24
29
static int machine_flywheel_spinup_thread (void * arg )
@@ -28,7 +33,11 @@ static int machine_flywheel_spinup_thread(void *arg)
28
33
pr_info ("Flywheel spins up\n" );
29
34
30
35
complete_all (& machine .flywheel_comp );
36
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (5 , 17 , 0 )
37
+ kthread_complete_and_exit (& machine .flywheel_comp , 0 );
38
+ #else
31
39
complete_and_exit (& machine .flywheel_comp , 0 );
40
+ #endif
32
41
}
33
42
34
43
static int completions_init (void )
You can’t perform that action at this time.
0 commit comments