Commit a5c1d8ec authored by Huang Shijie's avatar Huang Shijie Committed by Vinod Koul

dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.
	remove label err_dma_dev
Signed-off-by: default avatarHuang Shijie <sjhuang@iluvatar.ai>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 5b394b2d
...@@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev) ...@@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev)
fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
ret = dma_async_device_register(&fdev->dma_device); ret = dmaenginem_async_device_register(&fdev->dma_device);
if (ret) { if (ret) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to register DMA device (%d)\n", ret); "Failed to register DMA device (%d)\n", ret);
...@@ -844,15 +844,13 @@ static int st_fdma_probe(struct platform_device *pdev) ...@@ -844,15 +844,13 @@ static int st_fdma_probe(struct platform_device *pdev)
if (ret) { if (ret) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"Failed to register controller (%d)\n", ret); "Failed to register controller (%d)\n", ret);
goto err_dma_dev; goto err_rproc;
} }
dev_info(&pdev->dev, "ST FDMA engine driver, irq:%d\n", fdev->irq); dev_info(&pdev->dev, "ST FDMA engine driver, irq:%d\n", fdev->irq);
return 0; return 0;
err_dma_dev:
dma_async_device_unregister(&fdev->dma_device);
err_rproc: err_rproc:
st_fdma_free(fdev); st_fdma_free(fdev);
st_slim_rproc_put(fdev->slim_rproc); st_slim_rproc_put(fdev->slim_rproc);
...@@ -867,7 +865,6 @@ static int st_fdma_remove(struct platform_device *pdev) ...@@ -867,7 +865,6 @@ static int st_fdma_remove(struct platform_device *pdev)
devm_free_irq(&pdev->dev, fdev->irq, fdev); devm_free_irq(&pdev->dev, fdev->irq, fdev);
st_slim_rproc_put(fdev->slim_rproc); st_slim_rproc_put(fdev->slim_rproc);
of_dma_controller_free(pdev->dev.of_node); of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&fdev->dma_device);
return 0; return 0;
} }
......
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