diff --git a/sev-snp-simulator/sevguest.c b/sev-snp-simulator/sevguest.c index c884bdc7..d06c9b77 100644 --- a/sev-snp-simulator/sevguest.c +++ b/sev-snp-simulator/sevguest.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -352,7 +353,11 @@ static int __init sev_guest_init_module(void) { } sev_major = MAJOR(dev); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) sev_class = class_create(THIS_MODULE, DEVICE_NAME); +#else + sev_class = class_create(DEVICE_NAME); +#endif if (IS_ERR(sev_class)) { err = PTR_ERR(sev_class); goto fail;