lkml.org 
[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 37/46] dmaengine: imx-sdma: use dmaenginem_async_device_register to simplify the code
Date
Use dmaenginem_async_device_register to simplify the code:
remove dma_async_device_unregister.
remove label err_register

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

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index b4ec2d20e661..3ee28d044e3c 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -2062,7 +2062,7 @@ static int sdma_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, sdma);

- ret = dma_async_device_register(&sdma->dma_device);
+ ret = dmaenginem_async_device_register(&sdma->dma_device);
if (ret) {
dev_err(&pdev->dev, "unable to register\n");
goto err_init;
@@ -2072,7 +2072,7 @@ static int sdma_probe(struct platform_device *pdev)
ret = of_dma_controller_register(np, sdma_xlate, sdma);
if (ret) {
dev_err(&pdev->dev, "failed to register controller\n");
- goto err_register;
+ goto err_init;
}

spba_bus = of_find_compatible_node(NULL, NULL, "fsl,spba-bus");
@@ -2086,8 +2086,6 @@ static int sdma_probe(struct platform_device *pdev)

return 0;

-err_register:
- dma_async_device_unregister(&sdma->dma_device);
err_init:
kfree(sdma->script_addrs);
err_irq:
@@ -2103,7 +2101,6 @@ static int sdma_remove(struct platform_device *pdev)
int i;

devm_free_irq(&pdev->dev, sdma->irq, sdma);
- dma_async_device_unregister(&sdma->dma_device);
kfree(sdma->script_addrs);
clk_unprepare(sdma->clk_ahb);
clk_unprepare(sdma->clk_ipg);
--
2.17.1
\
 
 \ /
  Last update: 2018-08-03 09:25    [W:0.218 / U:9.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site