1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
From d128d10c5f1554254ce55f3c79ca08390279d628 Mon Sep 17 00:00:00 2001
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
Date: Sun, 8 Mar 2020 13:04:55 +0800
Subject: [PATCH] Support newer proc_ops interface for 5.6
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
acpi_call.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/acpi_call.c b/acpi_call.c
index 801798b..65eb344 100644
--- a/acpi_call.c
+++ b/acpi_call.c
@@ -348,11 +348,18 @@ static ssize_t acpi_proc_read( struct file *filp, char __user *buff,
return ret;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 6, 0)
static struct file_operations proc_acpi_operations = {
.owner = THIS_MODULE,
.read = acpi_proc_read,
.write = acpi_proc_write,
};
+#else
+static const struct proc_ops proc_acpi_operations = {
+ .proc_read = acpi_proc_read,
+ .proc_write = acpi_proc_write,
+};
+#endif
#else
static int acpi_proc_read(char *page, char **start, off_t off,
--
2.25.1
|