summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/core.c
diff options
context:
space:
mode:
authorJani Nikula <ext-jani.1.nikula@nokia.com>2010-05-07 11:58:41 +0200
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-05-18 14:06:08 +0200
commit368a148ea3833b540945fa53a63227c8ce76aa8f (patch)
treec84753a0abf298996a4833cfc25ac4ef7c67af1d /drivers/video/omap2/dss/core.c
parentboard-omap3-beagle: add DSS2 support (diff)
downloadlinux-368a148ea3833b540945fa53a63227c8ce76aa8f.tar.xz
linux-368a148ea3833b540945fa53a63227c8ce76aa8f.zip
OMAP: DSS2: omap_dss_probe() conditional compilation cleanup
Move a number of #ifdefs from code into dss.h and elsewhere, and conditionally define no-op static inline functions, cleaning up the code. This style is according to Documentation/SubmittingPatches. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/dss/core.c')
-rw-r--r--drivers/video/omap2/dss/core.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 6d54467e5e20..92ee06742ece 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -482,6 +482,14 @@ static void dss_uninitialize_debugfs(void)
if (dss_debugfs_dir)
debugfs_remove_recursive(dss_debugfs_dir);
}
+#else /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
+static inline int dss_initialize_debugfs(void)
+{
+ return 0;
+}
+static inline void dss_uninitialize_debugfs(void)
+{
+}
#endif /* CONFIG_DEBUG_FS && CONFIG_OMAP2_DSS_DEBUG_SUPPORT */
/* PLATFORM DEVICE */
@@ -518,56 +526,47 @@ static int omap_dss_probe(struct platform_device *pdev)
goto fail0;
}
-#ifdef CONFIG_OMAP2_DSS_RFBI
r = rfbi_init();
if (r) {
DSSERR("Failed to initialize rfbi\n");
goto fail0;
}
-#endif
-#ifdef CONFIG_OMAP2_DSS_DPI
r = dpi_init(pdev);
if (r) {
DSSERR("Failed to initialize dpi\n");
goto fail0;
}
-#endif
r = dispc_init();
if (r) {
DSSERR("Failed to initialize dispc\n");
goto fail0;
}
-#ifdef CONFIG_OMAP2_DSS_VENC
+
r = venc_init(pdev);
if (r) {
DSSERR("Failed to initialize venc\n");
goto fail0;
}
-#endif
+
if (cpu_is_omap34xx()) {
-#ifdef CONFIG_OMAP2_DSS_SDI
r = sdi_init(skip_init);
if (r) {
DSSERR("Failed to initialize SDI\n");
goto fail0;
}
-#endif
-#ifdef CONFIG_OMAP2_DSS_DSI
+
r = dsi_init(pdev);
if (r) {
DSSERR("Failed to initialize DSI\n");
goto fail0;
}
-#endif
}
-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
r = dss_initialize_debugfs();
if (r)
goto fail0;
-#endif
for (i = 0; i < pdata->num_devices; ++i) {
struct omap_dss_device *dssdev = pdata->devices[i];
@@ -595,27 +594,15 @@ static int omap_dss_remove(struct platform_device *pdev)
int i;
int c;
-#if defined(CONFIG_DEBUG_FS) && defined(CONFIG_OMAP2_DSS_DEBUG_SUPPORT)
dss_uninitialize_debugfs();
-#endif
-#ifdef CONFIG_OMAP2_DSS_VENC
venc_exit();
-#endif
dispc_exit();
-#ifdef CONFIG_OMAP2_DSS_DPI
dpi_exit();
-#endif
-#ifdef CONFIG_OMAP2_DSS_RFBI
rfbi_exit();
-#endif
if (cpu_is_omap34xx()) {
-#ifdef CONFIG_OMAP2_DSS_DSI
dsi_exit();
-#endif
-#ifdef CONFIG_OMAP2_DSS_SDI
sdi_exit();
-#endif
}
dss_exit();