diff options
author | Andrew F. Davis <afd@ti.com> | 2017-12-05 14:29:32 -0600 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2017-12-19 11:21:32 +0200 |
commit | d66c36a3ee79747e300ac68276ca1496b567df68 (patch) | |
tree | 72fe5e2202fbbaab0f6e0636d3aaa77e31a3375e /drivers/gpu/drm/omapdrm/dss/core.c | |
parent | bb5cdf8d1c76ea821af0ffa486337386a0ab66e7 (diff) | |
download | blackbird-op-linux-d66c36a3ee79747e300ac68276ca1496b567df68.tar.gz blackbird-op-linux-d66c36a3ee79747e300ac68276ca1496b567df68.zip |
drm: omapdrm: Simplify platform registration
Currently, calls into each file are used to register the various
platform drivers. Change this to a table of pointers to platform_driver
structs to allow using platform_register_drivers.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/core.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/core.c | 53 |
1 files changed, 15 insertions, 38 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/core.c b/drivers/gpu/drm/omapdrm/dss/core.c index 8b8477813864..acef7ece5783 100644 --- a/drivers/gpu/drm/omapdrm/dss/core.c +++ b/drivers/gpu/drm/omapdrm/dss/core.c @@ -28,52 +28,33 @@ #include "dss.h" /* INIT */ -static int (*dss_output_drv_reg_funcs[])(void) __initdata = { - dss_init_platform_driver, - dispc_init_platform_driver, +static struct platform_driver * const omap_dss_drivers[] = { + &omap_dsshw_driver, + &omap_dispchw_driver, #ifdef CONFIG_OMAP2_DSS_DSI - dsi_init_platform_driver, + &omap_dsihw_driver, #endif #ifdef CONFIG_OMAP2_DSS_VENC - venc_init_platform_driver, + &omap_venchw_driver, #endif #ifdef CONFIG_OMAP4_DSS_HDMI - hdmi4_init_platform_driver, + &omapdss_hdmi4hw_driver, #endif #ifdef CONFIG_OMAP5_DSS_HDMI - hdmi5_init_platform_driver, + &omapdss_hdmi5hw_driver, #endif }; -static void (*dss_output_drv_unreg_funcs[])(void) = { -#ifdef CONFIG_OMAP5_DSS_HDMI - hdmi5_uninit_platform_driver, -#endif -#ifdef CONFIG_OMAP4_DSS_HDMI - hdmi4_uninit_platform_driver, -#endif -#ifdef CONFIG_OMAP2_DSS_VENC - venc_uninit_platform_driver, -#endif -#ifdef CONFIG_OMAP2_DSS_DSI - dsi_uninit_platform_driver, -#endif - dispc_uninit_platform_driver, - dss_uninit_platform_driver, -}; - static struct platform_device *omap_drm_device; static int __init omap_dss_init(void) { int r; - int i; - for (i = 0; i < ARRAY_SIZE(dss_output_drv_reg_funcs); ++i) { - r = dss_output_drv_reg_funcs[i](); - if (r) - goto err_reg; - } + r = platform_register_drivers(omap_dss_drivers, + ARRAY_SIZE(omap_dss_drivers)); + if (r) + goto err_reg; omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0); if (IS_ERR(omap_drm_device)) { @@ -84,22 +65,18 @@ static int __init omap_dss_init(void) return 0; err_reg: - for (i = ARRAY_SIZE(dss_output_drv_reg_funcs) - i; - i < ARRAY_SIZE(dss_output_drv_reg_funcs); - ++i) - dss_output_drv_unreg_funcs[i](); + platform_unregister_drivers(omap_dss_drivers, + ARRAY_SIZE(omap_dss_drivers)); return r; } static void __exit omap_dss_exit(void) { - int i; - platform_device_unregister(omap_drm_device); - for (i = 0; i < ARRAY_SIZE(dss_output_drv_unreg_funcs); ++i) - dss_output_drv_unreg_funcs[i](); + platform_unregister_drivers(omap_dss_drivers, + ARRAY_SIZE(omap_dss_drivers)); } module_init(omap_dss_init); |