The devm_regmap_init_mmio() is described as follows:
"The return value will be an ERR_PTR() on error or a valid pointer"
Use IS_ERR() to fix incorrect handling return value
of devm_regmap_init_mmio.
Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
Signed-off-by: Lin Yujun <linyujun809@h-partners.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 0d88b1a670e1..5db8f077dcc0 100644
--- a/drivers/dma/xilinx/xdma.c
+++ b/drivers/dma/xilinx/xdma.c
@@ -1234,11 +1234,11 @@ static int xdma_probe(struct platform_device *pdev)
goto failed;
}
xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
&xdma_regmap_config);
- if (!xdev->rmap) {
+ if (IS_ERR(xdev->rmap)) {
xdma_err(xdev, "config regmap failed: %d", ret);
goto failed;
}
INIT_LIST_HEAD(&xdev->dma_dev.channels);
--
2.34.1