diff --git a/devices/ccat/module.c b/devices/ccat/module.c index 126014c9..cf74eca2 100644 --- a/devices/ccat/module.c +++ b/devices/ccat/module.c @@ -71,7 +71,11 @@ static int __init ccat_class_init(struct ccat_class *base) return -1; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) base->class = class_create(THIS_MODULE, base->name); +#else + base->class = class_create(base->name); +#endif if (!base->class) { pr_warn("Create device class '%s' failed\n", base->name); diff --git a/master/module.c b/master/module.c index 0ea51077..24fe036f 100644 --- a/master/module.c +++ b/master/module.c @@ -112,7 +112,11 @@ int __init ec_init_module(void) } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) class = class_create(THIS_MODULE, "EtherCAT"); +#else + class = class_create("EtherCAT"); +#endif if (IS_ERR(class)) { EC_ERR("Failed to create device class.\n"); ret = PTR_ERR(class);