]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/tilcdc: Use drm_module_platform_driver() helper
authorKory Maincent (TI.com) <kory.maincent@bootlin.com>
Fri, 23 Jan 2026 16:12:32 +0000 (17:12 +0100)
committerLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 11 Feb 2026 08:16:15 +0000 (09:16 +0100)
Use the drm_module_platform_driver() helper macro to simplify driver
registration. This macro handles both the platform driver registration
and the drm_firmware_drivers_only() check, making the custom init/exit
functions unnecessary.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Kory Maincent (TI.com) <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20260123-feature_tilcdc-v5-14-5a44d2aa3f6f@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
drivers/gpu/drm/tilcdc/tilcdc_drv.c

index 20f93240b335c8a6bf2418a9f2dcdb292456dab8..97380b623fca31b0d4c20e6cfc6cc479610e6459 100644 (file)
@@ -20,6 +20,7 @@
 #include <drm/drm_gem_dma_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_mm.h>
+#include <drm/drm_module.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_vblank.h>
 
@@ -532,23 +533,7 @@ static struct platform_driver tilcdc_platform_driver = {
        },
 };
 
-static int __init tilcdc_drm_init(void)
-{
-       if (drm_firmware_drivers_only())
-               return -ENODEV;
-
-       DBG("init");
-       return platform_driver_register(&tilcdc_platform_driver);
-}
-
-static void __exit tilcdc_drm_fini(void)
-{
-       DBG("fini");
-       platform_driver_unregister(&tilcdc_platform_driver);
-}
-
-module_init(tilcdc_drm_init);
-module_exit(tilcdc_drm_fini);
+drm_module_platform_driver(tilcdc_platform_driver);
 
 MODULE_AUTHOR("Rob Clark <robdclark@gmail.com");
 MODULE_DESCRIPTION("TI LCD Controller DRM Driver");