[PATCH 24/46] dmaengine: nbpfaxi: use dmaenginem_async_device_register to simplify the code

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


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

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

diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
index 8c7b2e8703da..def82e77f321 100644
--- a/drivers/dma/nbpfaxi.c
+++ b/drivers/dma/nbpfaxi.c
@@ -1437,18 +1437,16 @@ static int nbpf_probe(struct platform_device *pdev)

nbpf_configure(nbpf);

- ret = dma_async_device_register(dma_dev);
+ ret = dmaenginem_async_device_register(dma_dev);
if (ret < 0)
goto e_clk_off;

ret = of_dma_controller_register(np, nbpf_of_xlate, nbpf);
if (ret < 0)
- goto e_dma_dev_unreg;
+ goto e_clk_off;

return 0;

-e_dma_dev_unreg:
- dma_async_device_unregister(dma_dev);
e_clk_off:
clk_disable_unprepare(nbpf->clk);

@@ -1471,7 +1469,6 @@ static int nbpf_remove(struct platform_device *pdev)
}

of_dma_controller_free(pdev->dev.of_node);
- dma_async_device_unregister(&nbpf->dma_dev);
clk_disable_unprepare(nbpf->clk);

return 0;
--
2.17.1