Commit cb0bc2d0 authored by Etienne Carriere's avatar Etienne Carriere Committed by Vinod Koul

dmaengine: stm32-mdma: disable clock in case of error during probe

This patch disables the clock in case of error during probe. The unneeded
err_unregister label is renamed err_clk instead.
Signed-off-by: default avatarEtienne Carriere <etienne.carriere@st.com>
Signed-off-by: default avatarAmelie Delaunay <amelie.delaunay@st.com>
Link: https://lore.kernel.org/r/20200127085334.13163-4-amelie.delaunay@st.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 54d50c81
...@@ -1637,25 +1637,27 @@ static int stm32_mdma_probe(struct platform_device *pdev) ...@@ -1637,25 +1637,27 @@ static int stm32_mdma_probe(struct platform_device *pdev)
} }
dmadev->irq = platform_get_irq(pdev, 0); dmadev->irq = platform_get_irq(pdev, 0);
if (dmadev->irq < 0) if (dmadev->irq < 0) {
return dmadev->irq; ret = dmadev->irq;
goto err_clk;
}
ret = devm_request_irq(&pdev->dev, dmadev->irq, stm32_mdma_irq_handler, ret = devm_request_irq(&pdev->dev, dmadev->irq, stm32_mdma_irq_handler,
0, dev_name(&pdev->dev), dmadev); 0, dev_name(&pdev->dev), dmadev);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to request IRQ\n"); dev_err(&pdev->dev, "failed to request IRQ\n");
return ret; goto err_clk;
} }
ret = dmaenginem_async_device_register(dd); ret = dmaenginem_async_device_register(dd);
if (ret) if (ret)
return ret; goto err_clk;
ret = of_dma_controller_register(of_node, stm32_mdma_of_xlate, dmadev); ret = of_dma_controller_register(of_node, stm32_mdma_of_xlate, dmadev);
if (ret < 0) { if (ret < 0) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"STM32 MDMA DMA OF registration failed %d\n", ret); "STM32 MDMA DMA OF registration failed %d\n", ret);
goto err_unregister; goto err_clk;
} }
platform_set_drvdata(pdev, dmadev); platform_set_drvdata(pdev, dmadev);
...@@ -1668,7 +1670,9 @@ static int stm32_mdma_probe(struct platform_device *pdev) ...@@ -1668,7 +1670,9 @@ static int stm32_mdma_probe(struct platform_device *pdev)
return 0; return 0;
err_unregister: err_clk:
clk_disable_unprepare(dmadev->clk);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment