Skip to content

Commit

Permalink
Ensure Linux v6.5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jserv committed Apr 15, 2024
1 parent 1c31bac commit e1b4457
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/static_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ static int __init chardev_init(void)

pr_info("I was assigned major number %d\n", major);

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
cls = class_create(THIS_MODULE, DEVICE_NAME);
#else
cls = class_create(DEVICE_NAME);
#endif

device_create(cls, NULL, MKDEV(major, 0), NULL, DEVICE_NAME);

Expand Down

0 comments on commit e1b4457

Please sign in to comment.