mirror of
https://github.com/sysprog21/lkmpg.git
synced 2024-11-24 10:58:52 +08:00
Ensure Linux v6.5 compatibility
This commit is contained in:
parent
1c31bac22c
commit
e1b44579b0
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user