From patchwork Thu Feb 23 11:26:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 6895 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id EA86A23DEE for ; Thu, 23 Feb 2012 11:27:06 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 95E2DA18940 for ; Thu, 23 Feb 2012 11:27:06 +0000 (UTC) Received: by iabz7 with SMTP id z7so1926093iab.11 for ; Thu, 23 Feb 2012 03:27:06 -0800 (PST) Received: from mr.google.com ([10.50.155.231]) by 10.50.155.231 with SMTP id vz7mr1021466igb.26.1329996426118 (num_hops = 1); Thu, 23 Feb 2012 03:27:06 -0800 (PST) Received: by 10.50.155.231 with SMTP id vz7mr885037igb.26.1329996426018; Thu, 23 Feb 2012 03:27:06 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.11.10 with SMTP id r10csp8547ibr; Thu, 23 Feb 2012 03:27:05 -0800 (PST) Received: by 10.236.197.1 with SMTP id s1mr1159543yhn.89.1329996425007; Thu, 23 Feb 2012 03:27:05 -0800 (PST) Received: from bear.ext.ti.com (bear.ext.ti.com. [192.94.94.41]) by mx.google.com with ESMTPS id t5si1153241yht.28.2012.02.23.03.27.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 23 Feb 2012 03:27:04 -0800 (PST) Received-SPF: pass (google.com: domain of rnayak@ti.com designates 192.94.94.41 as permitted sender) client-ip=192.94.94.41; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rnayak@ti.com designates 192.94.94.41 as permitted sender) smtp.mail=rnayak@ti.com Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id q1NBR1Z7001847; Thu, 23 Feb 2012 05:27:02 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q1NBQxhB027202; Thu, 23 Feb 2012 16:56:59 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Thu, 23 Feb 2012 16:56:59 +0530 Received: from ula0131687.apr.dhcp.ti.com (ula0131687-172024136255.apr.dhcp.ti.com [172.24.136.255]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id q1NBQr71023412; Thu, 23 Feb 2012 16:56:59 +0530 (IST) From: Rajendra Nayak To: , , CC: , , , , , Rajendra Nayak Subject: [PATCH v2 1/6] mmc: omap_hsmmc: use platform_get_resource_byname for tx/rx DMA channels Date: Thu, 23 Feb 2012 16:56:44 +0530 Message-ID: <1329996409-26861-2-git-send-email-rnayak@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1329996409-26861-1-git-send-email-rnayak@ti.com> References: <1329996409-26861-1-git-send-email-rnayak@ti.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQnijOjbE4Z64w4VCrrPBrN6oA0sit6LFImeXMKuO97orNZzTpPAxOHf3Cb9LFlcm9TNwsJV From: Balaji T K Git rid of hardcoded tx/rx DMA channels based on pdev->id and use platform_get_resource_byname() to retrieve them instead. Signed-off-by: Balaji T K Signed-off-by: Rajendra Nayak Tested-by: Venkatraman S --- drivers/mmc/host/omap_hsmmc.c | 35 +++++++++++------------------------ 1 files changed, 11 insertions(+), 24 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index fd0c661..2a660ab 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1977,32 +1977,19 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) omap_hsmmc_conf_bus_power(host); - /* Select DMA lines */ - switch (host->id) { - case OMAP_MMC1_DEVID: - host->dma_line_tx = OMAP24XX_DMA_MMC1_TX; - host->dma_line_rx = OMAP24XX_DMA_MMC1_RX; - break; - case OMAP_MMC2_DEVID: - host->dma_line_tx = OMAP24XX_DMA_MMC2_TX; - host->dma_line_rx = OMAP24XX_DMA_MMC2_RX; - break; - case OMAP_MMC3_DEVID: - host->dma_line_tx = OMAP34XX_DMA_MMC3_TX; - host->dma_line_rx = OMAP34XX_DMA_MMC3_RX; - break; - case OMAP_MMC4_DEVID: - host->dma_line_tx = OMAP44XX_DMA_MMC4_TX; - host->dma_line_rx = OMAP44XX_DMA_MMC4_RX; - break; - case OMAP_MMC5_DEVID: - host->dma_line_tx = OMAP44XX_DMA_MMC5_TX; - host->dma_line_rx = OMAP44XX_DMA_MMC5_RX; - break; - default: - dev_err(mmc_dev(host->mmc), "Invalid MMC id\n"); + res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); + if (!res) { + dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); + goto err_irq; + } + host->dma_line_tx = 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"); goto err_irq; } + host->dma_line_rx = res->start; /* Request IRQ for MMC operations */ ret = request_irq(host->irq, omap_hsmmc_irq, 0,