diff options
author | Brandon Anderson <brandonand@google.com> | 2024-02-29 18:43:36 +0000 |
---|---|---|
committer | Brandon Anderson <brandonand@google.com> | 2024-03-01 02:12:35 +0000 |
commit | 2e02a231b513d6957b3aac939596502e5f61bb6c (patch) | |
tree | 30a8259b6240788ecccddb73f0c4e7bc462c6712 | |
parent | 665bfdc2249597d8ad8a7d409295d8347a054aea (diff) | |
download | trusty-2e02a231b513d6957b3aac939596502e5f61bb6c.tar.gz |
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>
-rw-r--r-- | drivers/trusty/trusty-ipc.c | 10 |
1 files changed, 9 insertions, 1 deletions
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 @@ static int __init tipc_init(void) } 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); |