[PATCH 4/4] mmc: davinci: suppress waring when using DT

David Lechner david at lechnology.com
Wed Mar 9 15:50:05 PST 2016


When using device tree dms resources are not obtained via IORESOURCE_DMA.
As a result, we would get warning even though DMA was working.

This fixes the problem by checking for dev.of_node and skipping trying to
get the dma platform resource if we are using device tree.

Signed-off-by: David Lechner <david at lechnology.com>
---
 drivers/mmc/host/davinci_mmc.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index b160feb..475704d 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1261,17 +1261,19 @@ static int __init davinci_mmcsd_probe(struct platform_device *pdev)
 	host = mmc_priv(mmc);
 	host->mmc = mmc;	/* Important */
 
-	r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
-	if (!r)
-		dev_warn(&pdev->dev, "RX DMA resource not specified\n");
-	else
-		host->rxdma = r->start;
+	if (!pdev->dev.of_node) {
+		r = platform_get_resource(pdev, IORESOURCE_DMA, 0);
+		if (!r)
+			dev_warn(&pdev->dev, "RX DMA resource not specified\n");
+		else
+			host->rxdma = r->start;
 
-	r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
-	if (!r)
-		dev_warn(&pdev->dev, "TX DMA resource not specified\n");
-	else
-		host->txdma = r->start;
+		r = platform_get_resource(pdev, IORESOURCE_DMA, 1);
+		if (!r)
+			dev_warn(&pdev->dev, "TX DMA resource not specified\n");
+		else
+			host->txdma = r->start;
+	}
 
 	host->mem_res = mem;
 	host->base = ioremap(mem->start, mem_size);
-- 
1.9.1




More information about the linux-arm-kernel mailing list