diff options
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/core.c')
-rw-r--r-- | drivers/video/fbdev/omap2/dss/core.c | 80 |
1 files changed, 27 insertions, 53 deletions
diff --git a/drivers/video/fbdev/omap2/dss/core.c b/drivers/video/fbdev/omap2/dss/core.c index 16751755d433..54eeb507f9b3 100644 --- a/drivers/video/fbdev/omap2/dss/core.c +++ b/drivers/video/fbdev/omap2/dss/core.c @@ -50,8 +50,6 @@ static char *def_disp_name; module_param_named(def_disp, def_disp_name, charp, 0); MODULE_PARM_DESC(def_disp, "default display name"); -static bool dss_initialized; - const char *omapdss_get_default_display_name(void) { return core.default_display_name; @@ -65,12 +63,6 @@ enum omapdss_version omapdss_get_version(void) } EXPORT_SYMBOL(omapdss_get_version); -bool omapdss_is_initialized(void) -{ - return dss_initialized; -} -EXPORT_SYMBOL(omapdss_is_initialized); - struct platform_device *dss_get_core_pdev(void) { return core.pdev; @@ -253,6 +245,8 @@ static struct platform_driver omap_dss_driver = { /* INIT */ static int (*dss_output_drv_reg_funcs[])(void) __initdata = { + dss_init_platform_driver, + dispc_init_platform_driver, #ifdef CONFIG_OMAP2_DSS_DSI dsi_init_platform_driver, #endif @@ -276,32 +270,32 @@ static int (*dss_output_drv_reg_funcs[])(void) __initdata = { #endif }; -static void (*dss_output_drv_unreg_funcs[])(void) __exitdata = { -#ifdef CONFIG_OMAP2_DSS_DSI - dsi_uninit_platform_driver, +static void (*dss_output_drv_unreg_funcs[])(void) = { +#ifdef CONFIG_OMAP5_DSS_HDMI + hdmi5_uninit_platform_driver, #endif -#ifdef CONFIG_OMAP2_DSS_DPI - dpi_uninit_platform_driver, +#ifdef CONFIG_OMAP4_DSS_HDMI + hdmi4_uninit_platform_driver, #endif -#ifdef CONFIG_OMAP2_DSS_SDI - sdi_uninit_platform_driver, +#ifdef CONFIG_OMAP2_DSS_VENC + venc_uninit_platform_driver, #endif #ifdef CONFIG_OMAP2_DSS_RFBI rfbi_uninit_platform_driver, #endif -#ifdef CONFIG_OMAP2_DSS_VENC - venc_uninit_platform_driver, +#ifdef CONFIG_OMAP2_DSS_SDI + sdi_uninit_platform_driver, #endif -#ifdef CONFIG_OMAP4_DSS_HDMI - hdmi4_uninit_platform_driver, +#ifdef CONFIG_OMAP2_DSS_DPI + dpi_uninit_platform_driver, #endif -#ifdef CONFIG_OMAP5_DSS_HDMI - hdmi5_uninit_platform_driver, +#ifdef CONFIG_OMAP2_DSS_DSI + dsi_uninit_platform_driver, #endif + dispc_uninit_platform_driver, + dss_uninit_platform_driver, }; -static bool dss_output_drv_loaded[ARRAY_SIZE(dss_output_drv_reg_funcs)]; - static int __init omap_dss_init(void) { int r; @@ -311,35 +305,20 @@ static int __init omap_dss_init(void) if (r) return r; - r = dss_init_platform_driver(); - if (r) { - DSSERR("Failed to initialize DSS platform driver\n"); - goto err_dss; - } - - r = dispc_init_platform_driver(); - if (r) { - DSSERR("Failed to initialize dispc platform driver\n"); - goto err_dispc; - } - - /* - * It's ok if the output-driver register fails. It happens, for example, - * when there is no output-device (e.g. SDI for OMAP4). - */ for (i = 0; i < ARRAY_SIZE(dss_output_drv_reg_funcs); ++i) { r = dss_output_drv_reg_funcs[i](); - if (r == 0) - dss_output_drv_loaded[i] = true; + if (r) + goto err_reg; } - dss_initialized = true; - return 0; -err_dispc: - dss_uninit_platform_driver(); -err_dss: +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_driver_unregister(&omap_dss_driver); return r; @@ -349,13 +328,8 @@ static void __exit omap_dss_exit(void) { int i; - for (i = 0; i < ARRAY_SIZE(dss_output_drv_unreg_funcs); ++i) { - if (dss_output_drv_loaded[i]) - dss_output_drv_unreg_funcs[i](); - } - - dispc_uninit_platform_driver(); - dss_uninit_platform_driver(); + for (i = 0; i < ARRAY_SIZE(dss_output_drv_unreg_funcs); ++i) + dss_output_drv_unreg_funcs[i](); platform_driver_unregister(&omap_dss_driver); } |