[PATCH 02/46] dmaengine: zynqmp_dma: use dmaenginem_async_device_register to simplify the code

From: Huang Shijie
Date: Fri Aug 03 2018 - 03:21:17 EST


Use dmaenginem_async_device_register to simplify the code,
remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@xxxxxxxxxxx>
---
drivers/dma/xilinx/zynqmp_dma.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
index c74a88b65039..acfc74b68717 100644
--- a/drivers/dma/xilinx/zynqmp_dma.c
+++ b/drivers/dma/xilinx/zynqmp_dma.c
@@ -1085,13 +1085,12 @@ static int zynqmp_dma_probe(struct platform_device *pdev)
p->dst_addr_widths = BIT(zdev->chan->bus_width / 8);
p->src_addr_widths = BIT(zdev->chan->bus_width / 8);

- dma_async_device_register(&zdev->common);
+ dmaenginem_async_device_register(&zdev->common);

ret = of_dma_controller_register(pdev->dev.of_node,
of_zynqmp_dma_xlate, zdev);
if (ret) {
dev_err(&pdev->dev, "Unable to register DMA to DT\n");
- dma_async_device_unregister(&zdev->common);
goto free_chan_resources;
}

@@ -1122,7 +1121,6 @@ static int zynqmp_dma_remove(struct platform_device *pdev)
struct zynqmp_dma_device *zdev = platform_get_drvdata(pdev);

of_dma_controller_free(pdev->dev.of_node);
- dma_async_device_unregister(&zdev->common);

zynqmp_dma_chan_remove(zdev->chan);
pm_runtime_disable(zdev->dev);
--
2.17.1