diff mbox series

[45/46] dmaengine: dma-axi-dmac: use dmaenginem_async_device_register to simplify the code

Message ID 20180803072016.21544-46-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:20 a.m. UTC
Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.
	remove label err_unregister_device

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

Patch

diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
index 15b2453d2647..d510184762e6 100644
--- a/drivers/dma/dma-axi-dmac.c
+++ b/drivers/dma/dma-axi-dmac.c
@@ -678,14 +678,14 @@  static int axi_dmac_probe(struct platform_device *pdev)
 
 	axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, 0x00);
 
-	ret = dma_async_device_register(dma_dev);
+	ret = dmaenginem_async_device_register(dma_dev);
 	if (ret)
 		goto err_clk_disable;
 
 	ret = of_dma_controller_register(pdev->dev.of_node,
 		of_dma_xlate_by_chan_id, dma_dev);
 	if (ret)
-		goto err_unregister_device;
+		goto err_clk_disable;
 
 	ret = request_irq(dmac->irq, axi_dmac_interrupt_handler, IRQF_SHARED,
 		dev_name(&pdev->dev), dmac);
@@ -698,8 +698,6 @@  static int axi_dmac_probe(struct platform_device *pdev)
 
 err_unregister_of:
 	of_dma_controller_free(pdev->dev.of_node);
-err_unregister_device:
-	dma_async_device_unregister(&dmac->dma_dev);
 err_clk_disable:
 	clk_disable_unprepare(dmac->clk);
 
@@ -713,7 +711,6 @@  static int axi_dmac_remove(struct platform_device *pdev)
 	of_dma_controller_free(pdev->dev.of_node);
 	free_irq(dmac->irq, dmac);
 	tasklet_kill(&dmac->chan.vchan.task);
-	dma_async_device_unregister(&dmac->dma_dev);
 	clk_disable_unprepare(dmac->clk);
 
 	return 0;