We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e5724af commit 2dffb2bCopy full SHA for 2dffb2b
1 file changed
examples/linux/nat20device/nat20device.c
@@ -396,7 +396,12 @@ static int __init nat20device_device_init(void) {
396
}
397
398
/* Create device class */
399
+#if defined(class_create)
400
+ nat20device_class = class_create(THIS_MODULE, NAT20DEVICE_DEVICE_NAME);
401
+#else
402
nat20device_class = class_create(NAT20DEVICE_DEVICE_NAME);
403
+#endif
404
+
405
if (IS_ERR(nat20device_class)) {
406
ret = PTR_ERR(nat20device_class);
407
pr_err("NAT20: Failed to create device class: %d\n", ret);
0 commit comments