diff options
author | Andrei Homescu <ahomescu@google.com> | 2024-03-25 22:34:30 +0000 |
---|---|---|
committer | Andrei Homescu <ahomescu@google.com> | 2024-03-25 23:38:39 +0000 |
commit | 00fa097b8eaa00754f634f6704243b695cdd232c (patch) | |
tree | ab7cb2722525efadbd84999f91aa5114f3aa8ac8 | |
parent | 5a11dd657ff3098cee18466fc96ebdc2f1a41fb6 (diff) | |
download | trusty-main.tar.gz |
Fix the TRUSTY_IPC_CLASS_CREATE_ARG_THIS_MODULE macro not
compiling correctly on pre-6.4 kernels.
Bug: 301606895
Change-Id: Ib968e93f509d1f3b9e9bda5ed9642b2117fabded
Signed-off-by: Andrei Homescu <ahomescu@google.com>
-rw-r--r-- | drivers/trusty/trusty-ipc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/trusty/trusty-ipc.c b/drivers/trusty/trusty-ipc.c index cc3d377..581c7c9 100644 --- a/drivers/trusty/trusty-ipc.c +++ b/drivers/trusty/trusty-ipc.c @@ -59,9 +59,15 @@ #endif #if (KERNEL_VERSION(6, 4, 0) <= LINUX_VERSION_CODE) -#define TRUSTY_IPC_CLASS_CREATE_ARG_THIS_MODULE +static struct class * __must_check trusty_ipc_class_create(const char *name) +{ + return class_create(name); +} #else -#define TRUSTY_IPC_CLASS_CREATE_ARG_THIS_MODULE THIS_MODULE, +static struct class * __must_check trusty_ipc_class_create(const char *name) +{ + return class_create(THIS_MODULE, name); +} #endif struct tipc_virtio_dev; @@ -2739,9 +2745,7 @@ static int __init tipc_init(void) } tipc_major = MAJOR(dev); - tipc_class = class_create( - TRUSTY_IPC_CLASS_CREATE_ARG_THIS_MODULE - KBUILD_MODNAME); + tipc_class = trusty_ipc_class_create(KBUILD_MODNAME); if (IS_ERR(tipc_class)) { ret = PTR_ERR(tipc_class); pr_err("%s: class_create failed: %d\n", __func__, ret); |