mirror of
https://github.com/archlinux-jerry/nvidia-340xx
synced 2024-11-18 13:50:40 +08:00
61 lines
2.2 KiB
Diff
61 lines
2.2 KiB
Diff
--- 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)
|