From: Miaoqian Lin Date: Sat, 8 Jan 2022 08:53:36 +0000 (+0000) Subject: dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe X-Git-Tag: accepted/tizen/unified/20230118.172025~2177 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f3a0737992cd0a39f2fbc5492a4f786551ecbd5;p=platform%2Fkernel%2Flinux-rpi.git dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe commit e831c7aba950f3ae94002b10321279654525e5ec upstream. The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: 4f3ceca254e0 ("dmaengine: stm32-dmamux: Add PM Runtime support") Signed-off-by: Miaoqian Lin Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220108085336.11992-1-linmq006@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c index a421643..d5d5573 100644 --- a/drivers/dma/stm32-dmamux.c +++ b/drivers/dma/stm32-dmamux.c @@ -292,10 +292,12 @@ static int stm32_dmamux_probe(struct platform_device *pdev) ret = of_dma_router_register(node, stm32_dmamux_route_allocate, &stm32_dmamux->dmarouter); if (ret) - goto err_clk; + goto pm_disable; return 0; +pm_disable: + pm_runtime_disable(&pdev->dev); err_clk: clk_disable_unprepare(stm32_dmamux->clk);