Skip to content

Commit

Permalink
fix: support kernel version >= 6.4.0 (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr4iv3rNope authored Jul 26, 2023
1 parent e2a975d commit c8898e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/acpi_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/version.h>

MODULE_AUTHOR("Thomas Renninger <[email protected]>");
MODULE_DESCRIPTION("ACPI EC access driver");
Expand Down Expand Up @@ -112,7 +113,12 @@ static int acpi_ec_create_dev(void) {
return err;
}

if (IS_ERR(dev_class = class_create(THIS_MODULE, "chardev"))) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
if (IS_ERR(dev_class = class_create(THIS_MODULE, "chardev")))
#else
if (IS_ERR(dev_class = class_create("chardev")))
#endif
{
printk(KERN_ERR "acpi_ec: Failed to create a class\n");
err = -1;
goto error;
Expand Down

0 comments on commit c8898e0

Please sign in to comment.