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 1111#include <linux/module.h> /* Specifically, a module */
1212#include <linux/printk.h>
1313#include <linux/types.h>
14+ #include <linux/uaccess.h> /* for get_user and put_user */
1415
1516#include <asm/errno.h>
1617
Original file line number Diff line number Diff line change 77#include <linux/kthread.h>
88#include <linux/module.h>
99#include <linux/printk.h>
10+ #include <linux/version.h>
1011
1112static struct {
1213 struct completion crank_comp ;
@@ -18,7 +19,11 @@ static int machine_crank_thread(void *arg)
1819 pr_info ("Turn the crank\n" );
1920
2021 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
2125 complete_and_exit (& machine .crank_comp , 0 );
26+ #endif
2227}
2328
2429static int machine_flywheel_spinup_thread (void * arg )
@@ -28,7 +33,11 @@ static int machine_flywheel_spinup_thread(void *arg)
2833 pr_info ("Flywheel spins up\n" );
2934
3035 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
3139 complete_and_exit (& machine .flywheel_comp , 0 );
40+ #endif
3241}
3342
3443static int completions_init (void )
You can’t perform that action at this time.
0 commit comments