Skip to contentSkip to conversation

dmaengine: tegra210-adma: use

PATCH In review Rosen Penev 2 participants 2 messages Jun 8

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 dmaengine: tegra210-adma: use

Simpler to call the proper function.

---
v3: change subject
v2: reword commit message

 drivers/dma/tegra210-adma.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/dma/tegra210-adma.c +3 -8
index 14e0c408ed1e..be2ad6e28618 100644
@@ -1073,14 +1073,9 @@ static int tegra_adma_probe(struct platform_device *pdev)
 		}
 	} else {
 		/* If no 'page' property found, then reg DT binding would be legacy */
-		res_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		if (res_base) {
-			tdma->base_addr = devm_ioremap_resource(&pdev->dev, res_base);
-			if (IS_ERR(tdma->base_addr))
-				return PTR_ERR(tdma->base_addr);
-		} else {
-			return -ENODEV;
-		}
+		tdma->base_addr = devm_platform_ioremap_resource(pdev, 0);
+		if (IS_ERR(tdma->base_addr))
+			return PTR_ERR(tdma->base_addr);
 
 		tdma->ch_base_addr = tdma->base_addr + cdata->ch_base_offset;
 	}

--
2.54.0

maintainer
#1 lore raw
Quoted 1 line · Rosen Penev

Simpler to call the proper function.

The existing functions are also proper, this is just a simplification.

Quoted 4 lines

---
v3: change subject

Subject looks incorrect.

Quoted 13 lines

v2: reword commit message

  drivers/dma/tegra210-adma.c | 11 +++--------
  1 file changed, 3 insertions(+), 8 deletions(-)
drivers/dma/tegra210-adma.c +0 -1
index 14e0c408ed1e..be2ad6e28618 100644
@@ -1073,14 +1073,9 @@ static int tegra_adma_probe(struct platform_device *pdev)
  		}
  	} else {
  		/* If no 'page' property found, then reg DT binding would be legacy */
-		res_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);

drivers/dma/tegra210-adma.c static int tegra_adma_probe(struct platform_device *pdev) · line 1078

Quoted 10 lines
drivers/dma/tegra210-adma.c +3 -7
-		if (res_base) {
-			tdma->base_addr = devm_ioremap_resource(&pdev->dev, res_base);
-			if (IS_ERR(tdma->base_addr))
-				return PTR_ERR(tdma->base_addr);
-		} else {
-			return -ENODEV;
-		}
+		tdma->base_addr = devm_platform_ioremap_resource(pdev, 0);
+		if (IS_ERR(tdma->base_addr))
+			return PTR_ERR(tdma->base_addr);

This no longer applies cleanly on top of Sheetal's change [0] and so will need to be rebased.

Jon

[0] https://lore.kernel.org/linux-tegra/[email protected]/

Signature · 1 line
nvpublic