From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Gross Subject: [PATCH v2 2/2] ARM: OMAP2+: Enable DT usage during dmm create Date: Wed, 10 Apr 2013 15:50:43 -0500 Message-ID: <1365627043-11846-3-git-send-email-andy.gross@ti.com> References: <1365627043-11846-1-git-send-email-andy.gross@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1365627043-11846-1-git-send-email-andy.gross@ti.com> Sender: linux-omap-owner@vger.kernel.org To: devicetree-discuss@lists.ozlabs.org Cc: Benoit Cousson , linux-omap@vger.kernel.org, Santosh Shilimkar , Nishanth Menon , Andy Gross List-Id: devicetree@vger.kernel.org If DMM device tree information is present, use it for creating the device. Otherwise fall back to using the hwmod entry. Signed-off-by: Andy Gross --- arch/arm/mach-omap2/drm.c | 17 +++++++++++------ 1 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/drm.c b/arch/arm/mach-omap2/drm.c index 59a4af7..e1e20ec 100644 --- a/arch/arm/mach-omap2/drm.c +++ b/arch/arm/mach-omap2/drm.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "soc.h" #include "omap_device.h" @@ -47,13 +48,17 @@ 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_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; -- 1.7.5.4