File 0023-kernel-6.2.patch of Package x11-video-nvidiaG02
diff -ruN NVIDIA-Linux-x86_64-304.137p2/kernel/conftest.sh NVIDIA-Linux-x86_64-304.137p1/kernel/conftest.sh
--- NVIDIA-Linux-x86_64-304.137p2/conftest.sh 2023-03-04 16:12:23.378417621 -0300
+++ NVIDIA-Linux-x86_64-304.137p1/conftest.sh 2023-03-04 16:26:01.880723368 -0300
@@ -760,12 +760,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
diff -ruN NVIDIA-Linux-x86_64-304.137p2/kernel/nv-acpi.c NVIDIA-Linux-x86_64-304.137p1/kernel/nv-acpi.c
--- NVIDIA-Linux-x86_64-304.137p2/nv-acpi.c 2023-03-04 16:23:21.599488932 -0300
+++ NVIDIA-Linux-x86_64-304.137p1/nv-acpi.c 2023-03-04 16:28:43.281966408 -0300
@@ -23,8 +23,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 **);
@@ -354,8 +358,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.
@@ -405,7 +413,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)