[PATCH] dmaengine: xilinx: xdma: Convert to devm_platform_ioremap_resource()

Yangtao Li frank.li at vivo.com
Tue Jul 11 19:44:21 PDT 2023


Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li at vivo.com>
---
patch based on next
 drivers/dma/xilinx/xdma.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index ad5ff63354cf..630927dc90e8 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -885,15 +885,9 @@ static int xdma_probe(struct platform_device *pdev)
 	xdev->irq_start = res->start;
 	xdev->irq_num = res->end - res->start + 1;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		xdma_err(xdev, "failed to get io resource");
-		goto failed;
-	}
-
-	reg_base = devm_ioremap_resource(&pdev->dev, res);
+	reg_base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(reg_base)) {
-		xdma_err(xdev, "ioremap failed");
+		ret = PTR_ERR(reg_base);
 		goto failed;
 	}
 
-- 
2.39.0




More information about the linux-arm-kernel mailing list