[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180803072016.21544-5-sjhuang@iluvatar.ai>
Date: Fri, 3 Aug 2018 15:19:34 +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 04/46] dmaengine: xgene-dma: use dmaenginem_async_device_register to simplify the code
Use dmaenginem_async_device_register to simplify the code:
remove xgene_dma_async_register
remove dma_async_device_unregister
Signed-off-by: Huang Shijie <sjhuang@...vatar.ai>
---
drivers/dma/xgene-dma.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
index 1d5988849aa6..192322bbdc29 100644
--- a/drivers/dma/xgene-dma.c
+++ b/drivers/dma/xgene-dma.c
@@ -1564,7 +1564,7 @@ static int xgene_dma_async_register(struct xgene_dma *pdma, int id)
list_add_tail(&chan->dma_chan.device_node, &dma_dev->channels);
/* Register with Linux async DMA framework*/
- ret = dma_async_device_register(dma_dev);
+ ret = dmaenginem_async_device_register(dma_dev);
if (ret) {
chan_err(chan, "Failed to register async device %d", ret);
tasklet_kill(&chan->tasklet);
@@ -1588,10 +1588,8 @@ static int xgene_dma_init_async(struct xgene_dma *pdma)
for (i = 0; i < XGENE_DMA_MAX_CHANNEL ; i++) {
ret = xgene_dma_async_register(pdma, i);
if (ret) {
- for (j = 0; j < i; j++) {
- dma_async_device_unregister(&pdma->dma_dev[j]);
+ for (j = 0; j < i; j++)
tasklet_kill(&pdma->chan[j].tasklet);
- }
return ret;
}
@@ -1600,14 +1598,6 @@ static int xgene_dma_init_async(struct xgene_dma *pdma)
return ret;
}
-static void xgene_dma_async_unregister(struct xgene_dma *pdma)
-{
- int i;
-
- for (i = 0; i < XGENE_DMA_MAX_CHANNEL; i++)
- dma_async_device_unregister(&pdma->dma_dev[i]);
-}
-
static void xgene_dma_init_channels(struct xgene_dma *pdma)
{
struct xgene_dma_chan *chan;
@@ -1796,8 +1786,6 @@ static int xgene_dma_remove(struct platform_device *pdev)
struct xgene_dma_chan *chan;
int i;
- xgene_dma_async_unregister(pdma);
-
/* Mask interrupts and disable DMA engine */
xgene_dma_mask_interrupts(pdma);
xgene_dma_disable(pdma);
--
2.17.1
Powered by blists - more mailing lists