dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe
authorZhang Shurong <zhang_shurong@foxmail.com>
Thu, 5 Oct 2023 14:28:35 +0000 (22:28 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 9 Oct 2023 05:26:51 +0000 (10:56 +0530)
The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed on the error handling path to
keep it balanced according to context.
We fix it by calling pm_runtime_disable when error returns.

Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/tencent_DD2D371DB5925B4B602B1E1D0A5FA88F1208@qq.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/ste_dma40.c

index 89e82508c13392c721de92969922cb001483b60d..002833fb1fa04cabddb058fa6c575d7ffc42247e 100644 (file)
@@ -3668,6 +3668,7 @@ static int __init d40_probe(struct platform_device *pdev)
                regulator_disable(base->lcpa_regulator);
                regulator_put(base->lcpa_regulator);
        }
+       pm_runtime_disable(base->dev);
 
  report_failure:
        d40_err(dev, "probe failed\n");