[PATCH v1] drivers: xilinx: Fix Judgment of the return value of the devm_ioremap_resource function

Minjie Du duminjie at vivo.com
Tue Jul 4 05:04:58 PDT 2023


IS_ERR() fix devm_ioremap_resource function return judge.
Could you help check it out?
Thank you!

Signed-off-by: Minjie Du <duminjie at vivo.com>
---
 drivers/dma/xilinx/xdma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/xdma.c b/drivers/dma/xilinx/xdma.c
index 93ee298d5..ad5ff6335 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -892,7 +892,7 @@ static int xdma_probe(struct platform_device *pdev)
 	}
 
 	reg_base = devm_ioremap_resource(&pdev->dev, res);
-	if (!reg_base) {
+	if (IS_ERR(reg_base)) {
 		xdma_err(xdev, "ioremap failed");
 		goto failed;
 	}
-- 
2.39.0




More information about the linux-arm-kernel mailing list