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) <[email protected]> --- 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 20f93240b335c..97380b623fca3 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> @@ -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 <[email protected]"); MODULE_DESCRIPTION("TI LCD Controller DRM Driver"); -- 2.43.0
