DMA Engine development
 help / color / mirror / Atom feed
* [PATCHv4] dmaengine: tegra210-adma: use platform to ioremap
@ 2026-06-09 21:25 Rosen Penev
  2026-06-10  1:42 ` Frank Li
  2026-06-10  8:43 ` Jon Hunter
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2026-06-09 21:25 UTC (permalink / raw)
  To: dmaengine
  Cc: Laxman Dewangan, Jon Hunter, Vinod Koul, Frank Li, Thierry Reding,
	open list:TEGRA ARCHITECTURE SUPPORT, open list

Simpler to call devm_platform_ioremap_resource() as it returns multiple
error messages for whichever part fails.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 v4: rebase and reword commit message
 v3: change subject
 v2: reword commit message
 drivers/dma/tegra210-adma.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index ceaee1e33e68..21a381d022cf 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -1087,15 +1087,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 dev_err_probe(&pdev->dev, -ENODEV,
-					     "failed to get memory resource\n");
-		}
+		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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-10  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 21:25 [PATCHv4] dmaengine: tegra210-adma: use platform to ioremap Rosen Penev
2026-06-10  1:42 ` Frank Li
2026-06-10  8:43 ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox