diff mbox series

[12/46] dmaengine: sun6i-dma: use helper dmaenginem_async_device_register

Message ID 20180803072016.21544-13-sjhuang@iluvatar.ai (mailing list archive)
State Changes Requested
Headers show
Series Use dmaenginem_async_device_register to simplify code | expand

Commit Message

Huang Shijie Aug. 3, 2018, 7:19 a.m. UTC
Use dmaenginem_async_device_register to simplify the code:
   remove dma_async_device_unregister
   remove the label err_dma_unregister

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/sun6i-dma.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 0cd13f17fc11..419d6090f9e1 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -1319,7 +1319,7 @@  static int sun6i_dma_probe(struct platform_device *pdev)
 		goto err_clk_disable;
 	}
 
-	ret = dma_async_device_register(&sdc->slave);
+	ret = dmaenginem_async_device_register(&sdc->slave);
 	if (ret) {
 		dev_warn(&pdev->dev, "Failed to register DMA engine device\n");
 		goto err_irq_disable;
@@ -1329,7 +1329,7 @@  static int sun6i_dma_probe(struct platform_device *pdev)
 					 sdc);
 	if (ret) {
 		dev_err(&pdev->dev, "of_dma_controller_register failed\n");
-		goto err_dma_unregister;
+		goto err_irq_disable;
 	}
 
 	if (sdc->cfg->clock_autogate_enable)
@@ -1337,8 +1337,6 @@  static int sun6i_dma_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_dma_unregister:
-	dma_async_device_unregister(&sdc->slave);
 err_irq_disable:
 	sun6i_kill_tasklet(sdc);
 err_clk_disable:
@@ -1355,7 +1353,6 @@  static int sun6i_dma_remove(struct platform_device *pdev)
 	struct sun6i_dma_dev *sdc = platform_get_drvdata(pdev);
 
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&sdc->slave);
 
 	sun6i_kill_tasklet(sdc);