[PATCH 20/46] dmaengine: sirf-dma: use dmaenginem_async_device_register to simplify the code

From: Huang Shijie
Date: Fri Aug 03 2018 - 03:22:30 EST


Use dmaenginem_async_device_register to simplify the code:
remove dma_async_device_unregister.
remove label unreg_dma_dev

Signed-off-by: Huang Shijie <sjhuang@xxxxxxxxxxx>
---
drivers/dma/sirf-dma.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/sirf-dma.c b/drivers/dma/sirf-dma.c
index a0733ac3edb1..de19880d4254 100644
--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -944,7 +944,7 @@ static int sirfsoc_dma_probe(struct platform_device *op)
/* Register DMA engine */
dev_set_drvdata(dev, sdma);

- ret = dma_async_device_register(dma);
+ ret = dmaenginem_async_device_register(dma);
if (ret)
goto free_irq;

@@ -952,7 +952,7 @@ static int sirfsoc_dma_probe(struct platform_device *op)
ret = of_dma_controller_register(dn, of_dma_sirfsoc_xlate, sdma);
if (ret) {
dev_err(dev, "failed to register DMA controller\n");
- goto unreg_dma_dev;
+ goto free_irq;
}

pm_runtime_enable(&op->dev);
@@ -960,8 +960,6 @@ static int sirfsoc_dma_probe(struct platform_device *op)

return 0;

-unreg_dma_dev:
- dma_async_device_unregister(dma);
free_irq:
free_irq(sdma->irq, sdma);
irq_dispose:
@@ -975,7 +973,6 @@ static int sirfsoc_dma_remove(struct platform_device *op)
struct sirfsoc_dma *sdma = dev_get_drvdata(dev);

of_dma_controller_free(op->dev.of_node);
- dma_async_device_unregister(&sdma->dma);
free_irq(sdma->irq, sdma);
tasklet_kill(&sdma->tasklet);
irq_dispose_mapping(sdma->irq);
--
2.17.1