]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drivers: rpmsg: class_destroy() is deprecated
authorJori Koolstra <jkoolstra@xs4all.nl>
Sun, 8 Mar 2026 14:08:49 +0000 (15:08 +0100)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 9 Mar 2026 14:33:28 +0000 (08:33 -0600)
The class_destroy() function documents that:

  Note, the pointer to be destroyed must have been created with a call
  to class_create().

However, class_create() is deprecated. rpmsg already uses
class_register() but the class_destroy() calls should also be replaced
with class_unregister().

Link: https://lore.kernel.org/all/2023040244-duffel-pushpin-f738@gregkh/
Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20260308140850.1138376-1-jkoolstra@xs4all.nl
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/rpmsg/rpmsg_core.c

index 96964745065b1fbdd46442c040e55c3680181736..948541656950a1fc80a0332d47344b6353c85560 100644 (file)
@@ -650,7 +650,7 @@ static int __init rpmsg_init(void)
        ret = bus_register(&rpmsg_bus);
        if (ret) {
                pr_err("failed to register rpmsg bus: %d\n", ret);
-               class_destroy(&rpmsg_class);
+               class_unregister(&rpmsg_class);
        }
        return ret;
 }
@@ -659,7 +659,7 @@ postcore_initcall(rpmsg_init);
 static void __exit rpmsg_fini(void)
 {
        bus_unregister(&rpmsg_bus);
-       class_destroy(&rpmsg_class);
+       class_unregister(&rpmsg_class);
 }
 module_exit(rpmsg_fini);