[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180803072016.21544-38-sjhuang@iluvatar.ai>
Date: Fri, 3 Aug 2018 15:20:07 +0800
From: Huang Shijie <sjhuang@...vatar.ai>
To: vkoul@...nel.org
Cc: dmaengine@...r.kernel.org, linux-kernel@...r.kernel.org,
dave.jiang@...el.com, radhey.shyam.pandey@...inx.com,
appana.durga.rao@...inx.com, jmkrzyszt@...il.com,
gomonovych@...il.com, peter.ujfalusi@...com, keescook@...omium.org,
horms+renesas@...ge.net.au, geert+renesas@...der.be,
shawnguo@...nel.org, baoyou.xie@...aro.org,
michal.simek@...inx.com, baohua@...nel.org,
ludovic.desroches@...rochip.com, linus.walleij@...aro.org,
david.brown@...aro.org, Huang Shijie <sjhuang@...vatar.ai>
Subject: [PATCH 37/46] dmaengine: imx-sdma: use dmaenginem_async_device_register to simplify the code
Use dmaenginem_async_device_register to simplify the code:
remove dma_async_device_unregister.
remove label err_register
Signed-off-by: Huang Shijie <sjhuang@...vatar.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
Powered by blists - more mailing lists