Sophie

Sophie

distrib > Mageia > 8 > aarch64 > by-pkgid > f7f04d4ba9ddfb1f4c84cf39b754de5b > files > 3

dkms-bbswitch-0.8-13.1.mga8.src.rpm


Adjust for proc_ops split out in kernel 5.6

Signed-off-by: Thomas Backlund <tmb@mageia.org>

diff -Nurp bbswitch-0.8.orig/bbswitch.c bbswitch-0.8/bbswitch.c
--- bbswitch-0.8.orig/bbswitch.c	2013-12-05 01:22:06.000000000 +0200
+++ bbswitch-0.8/bbswitch.c	2020-04-19 15:31:40.770151992 +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,12 +376,21 @@ static int bbswitch_pm_handler(struct no
     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 = {