From patchwork Tue Mar 5 21:13:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 2222101 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9C95740077 for ; Tue, 5 Mar 2013 21:14:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758616Ab3CEVNn (ORCPT ); Tue, 5 Mar 2013 16:13:43 -0500 Received: from mail-ie0-f178.google.com ([209.85.223.178]:54170 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756428Ab3CEVND (ORCPT ); Tue, 5 Mar 2013 16:13:03 -0500 Received: by mail-ie0-f178.google.com with SMTP id c13so8587278ieb.9 for ; Tue, 05 Mar 2013 13:13:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=i7Bn9LovNrfZpAaI4940opi8w1/PGEEvaAUoUid2RlU=; b=FRDphxpKcLu9YBn1/WE7HgsYXAXGewOLlFijgxrIJ1rSt7H+wbT9UcwYqLMPGQZK0/ 9CsNeMrLyG4Z+wXHUiBoYkbXCKbWGBHrYloFnCqyNX19sWCpZHmib3xffRZ0wVexuC2V ekgLUHJ6osHr9uxvG8NmAsN7WZ6sBCTei1SYnUE/XLDWnq5kJXWRy9gyQfeSlj82vfJO /BlghYPjLics9fC+7RRQbsrirDvPSrhgU4RyI4clp563/qf0wYpjF7mjWGKIYlSIZ1Eb H/XUKgqgU+a151ay/P12EwRqMhTE/Kn8mBnN9JM7ljtg6/16WFhNI9LXzejbMKiQKUr4 xWmA== X-Received: by 10.43.7.7 with SMTP id om7mr28199862icb.25.1362517982425; Tue, 05 Mar 2013 13:13:02 -0800 (PST) Received: from beef.ohporter.com (cpe-98-27-254-98.neo.res.rr.com. [98.27.254.98]) by mx.google.com with ESMTPS id in10sm16921383igc.1.2013.03.05.13.13.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Mar 2013 13:13:01 -0800 (PST) From: Matt Porter To: Balaji T K , Chris Ball , Grant Likely , Rob Herring Cc: Vinod Koul , Tony Lindgren , Devicetree Discuss , Linux OMAP List , Linux Kernel Mailing List , Linux MMC List , Arnd Bergmann , Dan Williams , Jon Hunter , Santosh Shilimkar Subject: [PATCH v2 2/3] mmc: omap_hsmmc: Skip platform_get_resource_byname() for dt case Date: Tue, 5 Mar 2013 16:13:23 -0500 Message-Id: <1362518004-7083-3-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1362518004-7083-1-git-send-email-mporter@ti.com> References: <1362518004-7083-1-git-send-email-mporter@ti.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Santosh Shilimkar MMC driver probe will abort for DT case because of failed platform_get_resource_byname() lookup. Fix it by skipping resource byname lookup for device tree build. Issue is hidden because hwmod popullates the IO resources which helps to succeed platform_get_resource_byname() and probe. Signed-off-by: Santosh Shilimkar --- drivers/mmc/host/omap_hsmmc.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index e79b12d..8ae1225 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1896,21 +1896,23 @@ static int omap_hsmmc_probe(struct platform_device *pdev) omap_hsmmc_conf_bus_power(host); - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); - if (!res) { - dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); - ret = -ENXIO; - goto err_irq; - } - tx_req = res->start; + if (!pdev->dev.of_node) { + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); + if (!res) { + dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); + ret = -ENXIO; + goto err_irq; + } + tx_req = res->start; - res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); - if (!res) { - dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); - ret = -ENXIO; - goto err_irq; + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); + if (!res) { + dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); + ret = -ENXIO; + goto err_irq; + } + rx_req = res->start; } - rx_req = res->start; dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask);