summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorSanel Zukan <sanelz@gmail.com>2020-10-29 11:35:40 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2020-10-31 00:29:50 +0700
commit29fb3823f86ab4153a8665b89626a0e221c18675 (patch)
treef40ebffd9b0649b335d486d6b4efc68c2bc13931 /system
parent5ab59df3557c816c65893488a38396888bce7d45 (diff)
downloadslackbuilds-29fb3823f86ab4153a8665b89626a0e221c18675.tar.gz
system/acpi_call: Allow acpi_call to be built with 5.x kernels.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/acpi_call/acpi_call.SlackBuild1
-rw-r--r--system/acpi_call/fix-5.x-kernel.patch29
2 files changed, 30 insertions, 0 deletions
diff --git a/system/acpi_call/acpi_call.SlackBuild b/system/acpi_call/acpi_call.SlackBuild
index 9be2bed29b..cbba19ee17 100644
--- a/system/acpi_call/acpi_call.SlackBuild
+++ b/system/acpi_call/acpi_call.SlackBuild
@@ -65,6 +65,7 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
patch -p0 < $CWD/fix-acpi-include.patch
+patch -p0 < $CWD/fix-5.x-kernel.patch
make KDIR=$KERNELPATH
diff --git a/system/acpi_call/fix-5.x-kernel.patch b/system/acpi_call/fix-5.x-kernel.patch
new file mode 100644
index 0000000000..5ed4392857
--- /dev/null
+++ b/system/acpi_call/fix-5.x-kernel.patch
@@ -0,0 +1,29 @@
+--- acpi_call.c.orig 2020-10-28 23:05:01.875849692 +0100
++++ acpi_call.c 2020-10-28 23:07:50.658179392 +0100
+@@ -7,6 +7,7 @@
+ #include <linux/slab.h>
+ #include <asm/uaccess.h>
+ #include <linux/acpi.h>
++#include <linux/uaccess.h>
+
+ MODULE_LICENSE("GPL");
+
+@@ -317,11 +318,18 @@
+ return ret;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++static struct proc_ops proc_acpi_operations = {
++ .proc_read = acpi_proc_read,
++ .proc_write = acpi_proc_write,
++};
++#else
+ static struct file_operations proc_acpi_operations = {
+ .owner = THIS_MODULE,
+ .read = acpi_proc_read,
+ .write = acpi_proc_write,
+ };
++#endif
+
+ #else
+ static int acpi_proc_read(char *page, char **start, off_t off,