[PATCH v3 14/22] drm/tilcdc: Use drm_module_platform_driver() helper
Kory Maincent (TI.com)
kory.maincent at bootlin.com
Tue Jan 6 09:42:30 PST 2026
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.
Signed-off-by: Kory Maincent (TI.com) <kory.maincent at bootlin.com>
---
Change in v3:
- New patch split from previous patch of the series.
---
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 19 ++-----------------
1 file changed, 2 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 34d0e81552912..a82a2494e23d9 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -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>
@@ -534,23 +535,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 at gmail.com");
MODULE_DESCRIPTION("TI LCD Controller DRM Driver");
--
2.43.0
More information about the linux-arm-kernel
mailing list