From ed0112437f85665b6473dbeb1229b4850c8635ef Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 6 Mar 2023 12:39:41 -0700 Subject: [PATCH] Fix system76_remove function on older kernels --- system76_acpi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system76_acpi.c b/system76_acpi.c index 9e5df26..9e42484 100644 --- a/system76_acpi.c +++ b/system76_acpi.c @@ -761,7 +761,11 @@ error: } // Remove a System76 ACPI device +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,2,0) static void system76_remove(struct acpi_device *acpi_dev) +#else +static int system76_remove(struct acpi_device *acpi_dev) +#endif { struct system76_data *data; @@ -777,6 +781,10 @@ static void system76_remove(struct acpi_device *acpi_dev) devm_led_classdev_unregister(&acpi_dev->dev, &data->kb_led); system76_get(data, "FINI"); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(6,2,0) + return 0; +#endif } static struct acpi_driver system76_driver = {