From e32b292cc1ba089db6ed28e4d5eb0fc8cc4c2235 Mon Sep 17 00:00:00 2001
From: esi <git@esibun.net>
Date: Fri, 12 May 2023 16:28:01 -0400
Subject: [PATCH] [module] Fix build on Linux 6.4 (fixes #1075)

---
 module/dkms.conf | 2 +-
 module/kvmfr.c   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/module/dkms.conf b/module/dkms.conf
index a5f86bdd0..9d2a02c0e 100644
--- a/module/dkms.conf
+++ b/module/dkms.conf
@@ -1,5 +1,5 @@
 PACKAGE_NAME="kvmfr"
-PACKAGE_VERSION="0.0.8"
+PACKAGE_VERSION="0.0.9"
 BUILT_MODULE_NAME[0]="${PACKAGE_NAME}"
 MAKE[0]="make KDIR=${kernel_source_dir}"
 CLEAN="make KDIR=${kernel_source_dir} clean"
diff --git a/module/kvmfr.c b/module/kvmfr.c
index ca0cca685..c711e000e 100644
--- a/module/kvmfr.c
+++ b/module/kvmfr.c
@@ -539,7 +539,11 @@ static int __init kvmfr_module_init(void)
   if (kvmfr->major < 0)
     goto out_free;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
   kvmfr->pClass = class_create(THIS_MODULE, KVMFR_DEV_NAME);
+#else
+  kvmfr->pClass = class_create(KVMFR_DEV_NAME);
+#endif
   if (IS_ERR(kvmfr->pClass))
     goto out_unreg;
