diff mbox

[v2,2/2] ARM: OMAP2+: Don't create DMM if DT present

Message ID 1363812642-2921-3-git-send-email-andy.gross@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andy Gross March 20, 2013, 8:50 p.m. UTC
Added code to conditionally skip over creating a DMM device from the
hwmod information if there is a DMM node present in the DT.

Signed-off-by: Andy Gross <andy.gross@ti.com>
---
 arch/arm/mach-omap2/drm.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c
index 59a4af7..01a0c6a 100644
--- a/arch/arm/mach-omap2/drm.c
+++ b/arch/arm/mach-omap2/drm.c
@@ -24,6 +24,7 @@ 
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/platform_data/omap_drm.h>
+#include <linux/of.h>
 
 #include "soc.h"
 #include "omap_device.h"
@@ -47,13 +48,18 @@  static int __init omap_init_drm(void)
 	struct omap_hwmod *oh = NULL;
 	struct platform_device *pdev;
 
-	/* lookup and populate the DMM information, if present - OMAP4+ */
-	oh = omap_hwmod_lookup("dmm");
+	if (!of_have_populated_dt()  ||
+		!of_find_compatible_node(NULL, NULL, "ti,dmm")) {
 
-	if (oh) {
-		pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
-		WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
-			oh->name);
+		/* resort to hwmod lookup - LEGACY */
+		/* lookup and populate the DMM information, OMAP4+ only */
+		oh = omap_hwmod_lookup("dmm");
+
+		if (oh) {
+			pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
+			WARN(IS_ERR(pdev), "Could not build device for %s\n",
+				oh->name);
+		}
 	}
 
 	platform_data.omaprev = GET_OMAP_TYPE;