From 407ac124113338e85ac403367ea04ee479f00ad7 Mon Sep 17 00:00:00 2001 From: Matt Gray Date: Thu, 19 Jan 2023 00:01:19 +0000 Subject: [PATCH 1/2] fix incompatible pointer error --- src/clevo_acpi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/clevo_acpi.c b/src/clevo_acpi.c index 9b246eb..8d8c31c 100644 --- a/src/clevo_acpi.c +++ b/src/clevo_acpi.c @@ -128,12 +128,11 @@ static int clevo_acpi_add(struct acpi_device *device) return 0; } -static int clevo_acpi_remove(struct acpi_device *device) +static void clevo_acpi_remove(struct acpi_device *device) { pr_debug("clevo_acpi driver remove\n"); clevo_keyboard_remove_interface(&clevo_acpi_interface); active_driver_data = NULL; - return 0; } void clevo_acpi_notify(struct acpi_device *device, u32 event) From ec5fbfadc207cc66bc0c16022c7cd0874c17b169 Mon Sep 17 00:00:00 2001 From: Matt Gray Date: Thu, 19 Jan 2023 22:12:36 +0000 Subject: [PATCH 2/2] Added linux version check --- src/clevo_acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/clevo_acpi.c b/src/clevo_acpi.c index 8d8c31c..10a3f96 100644 --- a/src/clevo_acpi.c +++ b/src/clevo_acpi.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "clevo_interfaces.h" #define DRIVER_NAME "clevo_acpi" @@ -128,11 +129,18 @@ static int clevo_acpi_add(struct acpi_device *device) return 0; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0) +static int clevo_acpi_remove(struct acpi_device *device) +#else static void clevo_acpi_remove(struct acpi_device *device) +#endif { pr_debug("clevo_acpi driver remove\n"); clevo_keyboard_remove_interface(&clevo_acpi_interface); active_driver_data = NULL; +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0) + return 0; +#endif } void clevo_acpi_notify(struct acpi_device *device, u32 event)