]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dmaengine: xilinx: xdma: Fix regmap init error handling
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Tue, 14 Oct 2025 06:13:08 +0000 (08:13 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 9 Mar 2026 07:21:22 +0000 (08:21 +0100)
devm_regmap_init_mmio returns an ERR_PTR() upon error, not NULL.
Fix the error check and also fix the error message. Use the error code
from ERR_PTR() instead of the wrong value in ret.

Fixes: 17ce252266c7 ("dmaengine: xilinx: xdma: Add xilinx xdma driver")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251014061309.283468-1-alexander.stein@ew.tq-group.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/xilinx/xdma.c

index d02a4dac2291940519653a4fa7161b3ef3b8abd9..782a55edc55b82ba503fe54752f62166ae2fa8ea 100644 (file)
@@ -1234,8 +1234,8 @@ static int xdma_probe(struct platform_device *pdev)
 
        xdev->rmap = devm_regmap_init_mmio(&pdev->dev, reg_base,
                                           &xdma_regmap_config);
-       if (!xdev->rmap) {
-               xdma_err(xdev, "config regmap failed: %d", ret);
+       if (IS_ERR(xdev->rmap)) {
+               xdma_err(xdev, "config regmap failed: %pe", xdev->rmap);
                goto failed;
        }
        INIT_LIST_HEAD(&xdev->dma_dev.channels);