diff --git a/fibdrv.c b/fibdrv.c index a78f3d2..1bb2d12 100644 --- a/fibdrv.c +++ b/fibdrv.c @@ -6,6 +6,7 @@ #include #include #include +#include MODULE_LICENSE("Dual MIT/GPL"); MODULE_AUTHOR("National Cheng Kung University, Taiwan"); @@ -118,9 +119,11 @@ static int __init init_fib_dev(void) goto failed_cdev; } fib_dev = MKDEV(major, minor); - +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) + fib_class = class_create(DEV_FIBONACCI_NAME); +#else fib_class = class_create(THIS_MODULE, DEV_FIBONACCI_NAME); - +#endif if (!fib_class) { printk(KERN_ALERT "Failed to create device class\n"); rc = -3;