Skip to content

Commit

Permalink
Merge pull request #38 from hungyuhang/master
Browse files Browse the repository at this point in the history
Fix build issue with Linux v6.4 and later
  • Loading branch information
jserv authored May 20, 2024
2 parents fafca62 + a7e6f0e commit 34056d3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions control.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ int __init create_control_device(const char *dev_name)
goto kmalloc_failure;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0)
ctldev->dev_class = class_create(dev_name);
#else
ctldev->dev_class = class_create(THIS_MODULE, dev_name);
#endif
if (!(ctldev->dev_class)) {
pr_err("Error creating device class for control device\n");
ret = -ENODEV;
Expand Down

0 comments on commit 34056d3

Please sign in to comment.