From 52809e7c984ddf19b827081e56e922f992152e92 Mon Sep 17 00:00:00 2001 From: yss <12716694+chanharabomber@users.noreply.github.com> Date: Wed, 31 Jul 2024 00:12:33 +0900 Subject: [PATCH] Fix error: passing argument 1 of class_create --- driver/ptx_chrdev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/driver/ptx_chrdev.c b/driver/ptx_chrdev.c index dec1cee..d089dcd 100644 --- a/driver/ptx_chrdev.c +++ b/driver/ptx_chrdev.c @@ -14,6 +14,7 @@ #include #include #include +#include static LIST_HEAD(ctx_list); static DEFINE_MUTEX(ctx_list_lock); @@ -570,7 +571,11 @@ int ptx_chrdev_context_create(const char *name, const char *devname, INIT_LIST_HEAD(&ctx->group_list); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) ctx->class = class_create(THIS_MODULE, name); +#else + ctx->class = class_create(name); +#endif if (IS_ERR(ctx->class)) { pr_err("ptx_chrdev_context_create: class_create(\"%s\") failed.\n", name);