1 diff -up bbswitch-0.8/bbswitch.c.5.6fix bbswitch-0.8/bbswitch.c
2 --- bbswitch-0.8/bbswitch.c.5.6fix 2020-04-27 21:03:31.374417071 -0400
3 +++ bbswitch-0.8/bbswitch.c 2020-04-28 20:10:56.479080120 -0400
4 @@ -35,6 +35,10 @@
5 #include <linux/suspend.h>
6 #include <linux/seq_file.h>
7 #include <linux/pm_runtime.h>
8 +#include <linux/version.h>
9 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
10 +#include <linux/proc_fs.h>
11 +#endif
12
13 #define BBSWITCH_VERSION "0.8"
14
15 @@ -375,6 +379,15 @@ static int bbswitch_pm_handler(struct no
16 return 0;
17 }
18
19 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
20 +static struct proc_ops bbswitch_fops = {
21 + .proc_open = bbswitch_proc_open,
22 + .proc_read = seq_read,
23 + .proc_write = bbswitch_proc_write,
24 + .proc_lseek = seq_lseek,
25 + .proc_release= single_release
26 +};
27 +#else
28 static struct file_operations bbswitch_fops = {
29 .open = bbswitch_proc_open,
30 .read = seq_read,
31 @@ -382,6 +395,7 @@ static struct file_operations bbswitch_f
32 .llseek = seq_lseek,
33 .release= single_release
34 };
35 +#endif
36
37 static struct notifier_block nb = {
38 .notifier_call = &bbswitch_pm_handler
|