Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix module building failed after Linux 6.4 #13

Merged
merged 2 commits into from
Sep 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions fibdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/version.h>

MODULE_LICENSE("Dual MIT/GPL");
MODULE_AUTHOR("National Cheng Kung University, Taiwan");
Expand Down Expand Up @@ -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)
jserv marked this conversation as resolved.
Show resolved Hide resolved
fib_class = class_create(THIS_MODULE, DEV_FIBONACCI_NAME);

#else
fib_class = class_create(DEV_FIBONACCI_NAME);
#endif
if (!fib_class) {
printk(KERN_ALERT "Failed to create device class\n");
rc = -3;
Expand Down