Skip to content

Commit e1b4457

Browse files
committed
Ensure Linux v6.5 compatibility
1 parent 1c31bac commit e1b4457

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/static_key.c

+4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ static int __init chardev_init(void)
6161

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

64+
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
6465
cls = class_create(THIS_MODULE, DEVICE_NAME);
66+
#else
67+
cls = class_create(DEVICE_NAME);
68+
#endif
6569

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

0 commit comments

Comments
 (0)