Register the built-in TSM class with subsys_initcall() so it exists before a platform TSM driver probes, independently of object link order. CONFIG_TSM is boolean; remove the unused module exit path. Signed-off-by: Aneesh Kumar K.V (Arm) --- drivers/virt/coco/tsm-core.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/virt/coco/tsm-core.c b/drivers/virt/coco/tsm-core.c index 2fa746d078b3..bf09bb4546de 100644 --- a/drivers/virt/coco/tsm-core.c +++ b/drivers/virt/coco/tsm-core.c @@ -115,13 +115,7 @@ static int __init tsm_init(void) { return class_register(&tsm_class); } -module_init(tsm_init) - -static void __exit tsm_exit(void) -{ - class_unregister(&tsm_class); -} -module_exit(tsm_exit) +subsys_initcall(tsm_init) MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("TEE Security Manager Class Device"); -- 2.43.0