diff mbox

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

Message ID 1457567405-30475-5-git-send-email-david@lechnology.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Lechner March 9, 2016, 11:50 p.m. UTC
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@lechnology.com>
---
 drivers/mmc/host/davinci_mmc.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

Comments

Sekhar Nori March 14, 2016, 1:41 p.m. UTC | #1
On Thursday 10 March 2016 05:20 AM, David Lechner wrote:
> 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@lechnology.com>

Actually, with Peter's series adding dma_slave_map[] for all
mach-davinci platforms, this code should not be needed at all. Can you
try that dropping the platform_get_resource() calls for DMA works with
linux-next?

Thanks,
Sekhar
David Lechner March 14, 2016, 10:54 p.m. UTC | #2
I've updated the patche set based on feedback. This is tested on linux-next with
LEGO MINDSTORMS EV3 (da850), both with and without device tree enabled.

David Lechner (5):
  mmc: davinci: remove matching string
  mmc: davinci: fix unwinding in probe
  mmc: davinci: prepare clock
  mmc: davinci: don't use dma platform resources
  arm: davinci: remove mmc dma resources

 arch/arm/mach-davinci/devices-da8xx.c |  20 ------
 arch/arm/mach-davinci/devices.c       |  16 -----
 drivers/mmc/host/davinci_mmc.c        | 112 +++++++++++-----------------------
 3 files changed, 37 insertions(+), 111 deletions(-)
Sekhar Nori March 15, 2016, 8:13 a.m. UTC | #3
Hi David,

On Tuesday 15 March 2016 04:24 AM, David Lechner wrote:
> I've updated the patche set based on feedback. This is tested on linux-next with
> LEGO MINDSTORMS EV3 (da850), both with and without device tree enabled.

When posting an updated series, please post as a fresh thread. Not as
reply to the original posting. With the later, there are more chances of
series being lost.

Thanks,
Sekhar
diff mbox

Patch

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);