dmaengine: xilinx: xdma: Convert to devm_platform_ioremap_resource()

Message ID 20230712024421.15005-1-frank.li@vivo.com
State New
Headers
Series dmaengine: xilinx: xdma: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 12, 2023, 2:44 a.m. UTC
  Use devm_platform_ioremap_resource() to simplify code.

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

Patch

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