From patchwork Sat Feb 4 14:51:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 6658 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 6C5F123E0E for ; Sat, 4 Feb 2012 14:52:05 +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 3481AA18643 for ; Sat, 4 Feb 2012 14:52:05 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id z7so8410368iab.11 for ; Sat, 04 Feb 2012 06:52:05 -0800 (PST) Received: by 10.50.15.169 with SMTP id y9mr2751176igc.9.1328367125014; Sat, 04 Feb 2012 06:52:05 -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.169.210 with SMTP id a18cs44992ibz; Sat, 4 Feb 2012 06:52:03 -0800 (PST) Received: by 10.101.2.32 with SMTP id e32mr5018230ani.13.1328367119741; Sat, 04 Feb 2012 06:51:59 -0800 (PST) Received: from comal.ext.ti.com (comal.ext.ti.com. [198.47.26.152]) by mx.google.com with ESMTPS id i8si10077463yhe.147.2012.02.04.06.51.59 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 04 Feb 2012 06:51:59 -0800 (PST) Received-SPF: neutral (google.com: 198.47.26.152 is neither permitted nor denied by best guess record for domain of a0131687@ula0131687) client-ip=198.47.26.152; Authentication-Results: mx.google.com; spf=neutral (google.com: 198.47.26.152 is neither permitted nor denied by best guess record for domain of a0131687@ula0131687) smtp.mail=a0131687@ula0131687 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q14EpsYu005164; Sat, 4 Feb 2012 08:51:55 -0600 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q14EpntG018204; Sat, 4 Feb 2012 20:21:54 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Sat, 4 Feb 2012 20:21:49 +0530 Received: from ula0131687 (h81-226.vpn.ti.com [172.24.81.226]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id q14EpjUX009870; Sat, 4 Feb 2012 20:21:45 +0530 (IST) Received: from a0131687 by ula0131687 with local (Exim 4.72) (envelope-from ) id 1Rtgxq-0002iO-SN; Sat, 04 Feb 2012 20:21:42 +0530 From: Rajendra Nayak To: , , CC: , , , , , Rajendra Nayak Subject: [PATCH 1/6] mmc: omap_hsmmc: use platform_get_resource_byname for tx/rx DMA channels Date: Sat, 4 Feb 2012 20:21:25 +0530 Message-ID: <1328367090-10402-2-git-send-email-rnayak@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1328367090-10402-1-git-send-email-rnayak@ti.com> References: <1328367090-10402-1-git-send-email-rnayak@ti.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkgbBR1gt3kSA/mLK4Sco2P05eN/zrB1MoATboWMJg0Zo8vnoljswRTz12KEnzRsE6MHZEM 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 --- 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,