summarylogtreecommitdiffstats
path: root/bbswitch-v0.8-proc_ops-struct.patch
diff options
context:
space:
mode:
Diffstat (limited to 'bbswitch-v0.8-proc_ops-struct.patch')
-rw-r--r--bbswitch-v0.8-proc_ops-struct.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/bbswitch-v0.8-proc_ops-struct.patch b/bbswitch-v0.8-proc_ops-struct.patch
new file mode 100644
index 00000000000..f894ad571b6
--- /dev/null
+++ b/bbswitch-v0.8-proc_ops-struct.patch
@@ -0,0 +1,37 @@
+diff a/bbswitch.c b/bbswitch.c
+--- a/bbswitch.c 2013-12-04 21:22:06.000000000 -0200
++++ b/bbswitch.c 2020-04-01 12:02:35.518754892 -0300
+@@ -35,6 +35,7 @@
+ #include <linux/suspend.h>
+ #include <linux/seq_file.h>
+ #include <linux/pm_runtime.h>
++#include <linux/version.h>
+
+ #define BBSWITCH_VERSION "0.8"
+
+@@ -375,13 +376,23 @@
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++static struct proc_ops bbswitch_fops = {
++ .proc_open = bbswitch_proc_open,
++ .proc_read = seq_read,
++ .proc_write = bbswitch_proc_write,
++ .proc_lseek = seq_lseek,
++ .proc_release= single_release
++};
++#else
+ static struct file_operations bbswitch_fops = {
+ .open = bbswitch_proc_open,
+ .read = seq_read,
+ .write = bbswitch_proc_write,
+ .llseek = seq_lseek,
+ .release= single_release
+-};
++ };
++#endif
+
+ static struct notifier_block nb = {
+ .notifier_call = &bbswitch_pm_handler
+