summarylogtreecommitdiffstats
path: root/0012-kernel-6.2.patch
blob: ed95d7463f62659075d9a11ea6859f51a3bc84e7 (plain)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- a/kernel/conftest.sh	2023-02-24 10:35:02.633467500 +0100
+++ b/kernel/conftest.sh	2023-02-24 11:13:02.892079164 +0100
@@ -794,12 +794,19 @@
 
             echo "$CONFTEST_PREAMBLE
             #include <linux/acpi.h>
+            #include <linux/version.h>
 
             acpi_op_remove conftest_op_remove_routine;
 
+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
+            void conftest_acpi_device_ops_remove(struct acpi_device *device) {
+                conftest_op_remove_routine(device);
+            }
+            #else
             int conftest_acpi_device_ops_remove(struct acpi_device *device) {
                 return conftest_op_remove_routine(device);
-            }" > conftest$$.c
+            }
+            #endif" > conftest$$.c
 
             $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
             rm -f conftest$$.c
--- a/kernel/nv-acpi.c	2023-02-24 10:35:02.643467765 +0100
+++ b/kernel/nv-acpi.c	2023-02-24 11:09:14.821580592 +0100
@@ -26,8 +26,12 @@
 #if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
 static int         nv_acpi_remove_two_args(struct acpi_device *device, int type);
 #else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
+static void        nv_acpi_remove_one_arg(struct acpi_device *device);
+#else
 static int         nv_acpi_remove_one_arg(struct acpi_device *device);
 #endif
+#endif
 
 static void        nv_acpi_event           (acpi_handle, u32, void *);
 static acpi_status nv_acpi_find_methods    (acpi_handle, u32, void *, void **);
@@ -356,8 +360,12 @@
 #if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
 static int nv_acpi_remove_two_args(struct acpi_device *device, int type)
 #else
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
+static void nv_acpi_remove_one_arg(struct acpi_device *device)
+#else
 static int nv_acpi_remove_one_arg(struct acpi_device *device)
 #endif
+#endif
 {
     /*
      * This function will cause RM to relinquish control of the VGA ACPI device.
@@ -407,7 +415,9 @@
         device->driver_data = NULL;
     }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
     return status;
+#endif
 }
 
 static void nv_acpi_event(acpi_handle handle, u32 event_type, void *data)