Trusty driver compat 6.4 class_create()
The Trusty driver from 5.10 needs an additional argument
to class_create to be compatible with kernels later than 6.4
Change-Id: I9367374d378219b49106f99cc29413babdc9a6d5
Bug: 301606895
Signed-off-by: Brandon Anderson <brandonand@google.com>
diff --git a/drivers/trusty/trusty-ipc.c b/drivers/trusty/trusty-ipc.c
index 04aa2d1..ae97605 100644
--- a/drivers/trusty/trusty-ipc.c
+++ b/drivers/trusty/trusty-ipc.c
@@ -57,6 +57,12 @@
#define TRUSTY_IPC_REGISTER_SHRINKER_ARG
#endif
+#if (KERNEL_VERSION(6, 4, 0) <= LINUX_VERSION_CODE)
+#define TRUSTY_IPC_CLASS_CREATE_ARG_THIS_MODULE
+#else
+#define TRUSTY_IPC_CLASS_CREATE_ARG_THIS_MODULE THIS_MODULE,
+#endif
+
struct tipc_virtio_dev;
struct tipc_dev_config {
@@ -2700,7 +2706,9 @@
}
tipc_major = MAJOR(dev);
- tipc_class = class_create(THIS_MODULE, KBUILD_MODNAME);
+ tipc_class = class_create(
+ TRUSTY_IPC_CLASS_CREATE_ARG_THIS_MODULE
+ KBUILD_MODNAME);
if (IS_ERR(tipc_class)) {
ret = PTR_ERR(tipc_class);
pr_err("%s: class_create failed: %d\n", __func__, ret);