DMA Engine development
 help / color / mirror / Atom feed
* [35/46] dmaengine: mtk-hsdma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:20 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/mediatek/mtk-hsdma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/mediatek/mtk-hsdma.c b/drivers/dma/mediatek/mtk-hsdma.c
index b7ec56ae02a6..a8b2e84e1556 100644
--- a/drivers/dma/mediatek/mtk-hsdma.c
+++ b/drivers/dma/mediatek/mtk-hsdma.c
@@ -977,7 +977,7 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
 		INIT_LIST_HEAD(&vc->desc_hw_processing);
 	}
 
-	err = dma_async_device_register(dd);
+	err = dmaenginem_async_device_register(dd);
 	if (err)
 		return err;
 
@@ -1007,7 +1007,6 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
 	return 0;
 
 err_unregister:
-	dma_async_device_unregister(dd);
 
 	return err;
 }
@@ -1035,7 +1034,6 @@ static int mtk_hsdma_remove(struct platform_device *pdev)
 	/* Disable hardware */
 	mtk_hsdma_hw_deinit(hsdma);
 
-	dma_async_device_unregister(&hsdma->ddev);
 	of_dma_controller_free(pdev->dev.of_node);
 
 	return 0;

^ permalink raw reply related

* [34/46] dmaengine: mxs-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:20 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/mxs-dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index ae5182ff0128..35193b31a9e0 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -847,7 +847,7 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 	mxs_dma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
 	mxs_dma->dma_device.device_issue_pending = mxs_dma_enable_chan;
 
-	ret = dma_async_device_register(&mxs_dma->dma_device);
+	ret = dmaenginem_async_device_register(&mxs_dma->dma_device);
 	if (ret) {
 		dev_err(mxs_dma->dma_device.dev, "unable to register\n");
 		return ret;
@@ -857,7 +857,6 @@ static int __init mxs_dma_probe(struct platform_device *pdev)
 	if (ret) {
 		dev_err(mxs_dma->dma_device.dev,
 			"failed to register controller\n");
-		dma_async_device_unregister(&mxs_dma->dma_device);
 	}
 
 	dev_info(mxs_dma->dma_device.dev, "initialized\n");

^ permalink raw reply related

* [33/46] dmaengine: pch_dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:20 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/pch_dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c
index afd8f27bda96..505463d077c0 100644
--- a/drivers/dma/pch_dma.c
+++ b/drivers/dma/pch_dma.c
@@ -922,7 +922,7 @@ static int pch_dma_probe(struct pci_dev *pdev,
 	pd->dma.device_prep_slave_sg = pd_prep_slave_sg;
 	pd->dma.device_terminate_all = pd_device_terminate_all;
 
-	err = dma_async_device_register(&pd->dma);
+	err = dmaenginem_async_device_register(&pd->dma);
 	if (err) {
 		dev_err(&pdev->dev, "Failed to register DMA device\n");
 		goto err_free_pool;
@@ -952,8 +952,6 @@ static void pch_dma_remove(struct pci_dev *pdev)
 	struct dma_chan *chan, *_c;
 
 	if (pd) {
-		dma_async_device_unregister(&pd->dma);
-
 		free_irq(pdev->irq, pd);
 
 		list_for_each_entry_safe(chan, _c, &pd->dma.channels,

^ permalink raw reply related

* [32/46] dmaengine: pl330: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:20 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/pl330.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 88750a34e859..e4bc330132c7 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -3037,7 +3037,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id)
 	pd->max_burst = ((pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) ?
 			 1 : PL330_MAX_BURST);
 
-	ret = dma_async_device_register(pd);
+	ret = dmaenginem_async_device_register(pd);
 	if (ret) {
 		dev_err(&adev->dev, "unable to register DMAC\n");
 		goto probe_err3;
@@ -3114,8 +3114,6 @@ static int pl330_remove(struct amba_device *adev)
 			devm_free_irq(&adev->dev, irq, pl330);
 	}
 
-	dma_async_device_unregister(&pl330->ddma);
-
 	/* Idle the DMAC */
 	list_for_each_entry_safe(pch, _p, &pl330->ddma.channels,
 			chan.device_node) {

^ permalink raw reply related

* [31/46] dmaengine: moxart-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:20 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/moxart-dma.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c
index e04499c1f27f..80bff27c5f9b 100644
--- a/drivers/dma/moxart-dma.c
+++ b/drivers/dma/moxart-dma.c
@@ -618,7 +618,7 @@ static int moxart_probe(struct platform_device *pdev)
 	}
 	mdc->irq = irq;
 
-	ret = dma_async_device_register(&mdc->dma_slave);
+	ret = dmaenginem_async_device_register(&mdc->dma_slave);
 	if (ret) {
 		dev_err(dev, "dma_async_device_register failed\n");
 		return ret;
@@ -627,7 +627,6 @@ static int moxart_probe(struct platform_device *pdev)
 	ret = of_dma_controller_register(node, moxart_of_xlate, mdc);
 	if (ret) {
 		dev_err(dev, "of_dma_controller_register failed\n");
-		dma_async_device_unregister(&mdc->dma_slave);
 		return ret;
 	}
 
@@ -642,8 +641,6 @@ static int moxart_remove(struct platform_device *pdev)
 
 	devm_free_irq(&pdev->dev, m->irq, m);
 
-	dma_async_device_unregister(&m->dma_slave);
-
 	if (pdev->dev.of_node)
 		of_dma_controller_free(pdev->dev.of_node);
 

^ permalink raw reply related

* [30/46] dmaengine: pxa_dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:20 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/pxa_dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/pxa_dma.c b/drivers/dma/pxa_dma.c
index b31c28b67ad3..21001ea078fb 100644
--- a/drivers/dma/pxa_dma.c
+++ b/drivers/dma/pxa_dma.c
@@ -1285,7 +1285,6 @@ static int pxad_remove(struct platform_device *op)
 
 	pxad_cleanup_debugfs(pdev);
 	pxad_free_channels(&pdev->slave);
-	dma_async_device_unregister(&pdev->slave);
 	return 0;
 }
 
@@ -1396,7 +1395,7 @@ static int pxad_init_dmadev(struct platform_device *op,
 		init_waitqueue_head(&c->wq_state);
 	}
 
-	return dma_async_device_register(&pdev->slave);
+	return dmaenginem_async_device_register(&pdev->slave);
 }
 
 static int pxad_probe(struct platform_device *op)

^ permalink raw reply related

* [29/46] dmaengine: hidma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/qcom/hidma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 43d4b00b8138..1d8130edea58 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -877,7 +877,7 @@ static int hidma_probe(struct platform_device *pdev)
 	if (rc)
 		goto uninit;
 
-	rc = dma_async_device_register(&dmadev->ddev);
+	rc = dmaenginem_async_device_register(&dmadev->ddev);
 	if (rc)
 		goto uninit;
 
@@ -924,7 +924,6 @@ static int hidma_remove(struct platform_device *pdev)
 	struct hidma_dev *dmadev = platform_get_drvdata(pdev);
 
 	pm_runtime_get_sync(dmadev->ddev.dev);
-	dma_async_device_unregister(&dmadev->ddev);
 	if (!dmadev->lldev->msi_support)
 		devm_free_irq(dmadev->ddev.dev, dmadev->irq, dmadev->lldev);
 	else

^ permalink raw reply related

* [28/46] dmaengine: rcar-dmac: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/sh/rcar-dmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 48ee35e2bce6..87130b3eef5c 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1884,7 +1884,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
 	 *
 	 * Default transfer size of 32 bytes requires 32-byte alignment.
 	 */
-	ret = dma_async_device_register(engine);
+	ret = dmaenginem_async_device_register(engine);
 	if (ret < 0)
 		goto error;
 
@@ -1898,10 +1898,7 @@ static int rcar_dmac_probe(struct platform_device *pdev)
 
 static int rcar_dmac_remove(struct platform_device *pdev)
 {
-	struct rcar_dmac *dmac = platform_get_drvdata(pdev);
-
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&dmac->engine);
 
 	pm_runtime_disable(&pdev->dev);
 

^ permalink raw reply related

* [27/46] dmaengine: usb-dmac: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/sh/usb-dmac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/sh/usb-dmac.c b/drivers/dma/sh/usb-dmac.c
index 1bb1a8e09025..c09d7c65c2c5 100644
--- a/drivers/dma/sh/usb-dmac.c
+++ b/drivers/dma/sh/usb-dmac.c
@@ -849,7 +849,7 @@ static int usb_dmac_probe(struct platform_device *pdev)
 	engine->device_tx_status = usb_dmac_tx_status;
 	engine->device_issue_pending = usb_dmac_issue_pending;
 
-	ret = dma_async_device_register(engine);
+	ret = dmaenginem_async_device_register(engine);
 	if (ret < 0)
 		goto error;
 
@@ -879,7 +879,6 @@ static int usb_dmac_remove(struct platform_device *pdev)
 	for (i = 0; i < dmac->n_channels; ++i)
 		usb_dmac_chan_remove(dmac, &dmac->channels[i]);
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&dmac->engine);
 
 	pm_runtime_disable(&pdev->dev);
 

^ permalink raw reply related

* [26/46] dmaengine: shdmac: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/sh/shdmac.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/dma/sh/shdmac.c b/drivers/dma/sh/shdmac.c
index 04a74e0a95b7..52060cd21e79 100644
--- a/drivers/dma/sh/shdmac.c
+++ b/drivers/dma/sh/shdmac.c
@@ -866,7 +866,7 @@ static int sh_dmae_probe(struct platform_device *pdev)
 
 	pm_runtime_put(&pdev->dev);
 
-	err = dma_async_device_register(&shdev->shdma_dev.dma_dev);
+	err = dmaenginem_async_device_register(&shdev->shdma_dev.dma_dev);
 	if (err < 0)
 		goto edmadevreg;
 
@@ -897,9 +897,6 @@ static int sh_dmae_probe(struct platform_device *pdev)
 static int sh_dmae_remove(struct platform_device *pdev)
 {
 	struct sh_dmae_device *shdev = platform_get_drvdata(pdev);
-	struct dma_device *dma_dev = &shdev->shdma_dev.dma_dev;
-
-	dma_async_device_unregister(dma_dev);
 
 	spin_lock_irq(&sh_dmae_lock);
 	list_del_rcu(&shdev->node);

^ permalink raw reply related

* [25/46] dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.
	return error if it fails.

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

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 13c68b6434ce..9f5869e1a017 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -530,9 +530,6 @@ static void mmp_tdma_issue_pending(struct dma_chan *chan)
 
 static int mmp_tdma_remove(struct platform_device *pdev)
 {
-	struct mmp_tdma_device *tdev = platform_get_drvdata(pdev);
-
-	dma_async_device_unregister(&tdev->device);
 	return 0;
 }
 
@@ -696,7 +693,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
 	dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
 	platform_set_drvdata(pdev, tdev);
 
-	ret = dma_async_device_register(&tdev->device);
+	ret = dmaenginem_async_device_register(&tdev->device);
 	if (ret) {
 		dev_err(tdev->device.dev, "unable to register\n");
 		return ret;
@@ -708,7 +705,7 @@ static int mmp_tdma_probe(struct platform_device *pdev)
 		if (ret) {
 			dev_err(tdev->device.dev,
 				"failed to register controller\n");
-			dma_async_device_unregister(&tdev->device);
+			return ret;
 		}
 	}
 

^ permalink raw reply related

* [24/46] dmaengine: nbpfaxi: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

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@iluvatar.ai>
---
 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;

^ permalink raw reply related

* [23/46] dmaengine: sa11x0-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/sa11x0-dma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/sa11x0-dma.c b/drivers/dma/sa11x0-dma.c
index b31d07c7d93c..9181d6048f43 100644
--- a/drivers/dma/sa11x0-dma.c
+++ b/drivers/dma/sa11x0-dma.c
@@ -863,7 +863,7 @@ static int sa11x0_dma_init_dmadev(struct dma_device *dmadev,
 		vchan_init(&c->vc, dmadev);
 	}
 
-	return dma_async_device_register(dmadev);
+	return dmaenginem_async_device_register(dmadev);
 }
 
 static int sa11x0_dma_request_irq(struct platform_device *pdev, int nr,
@@ -987,8 +987,6 @@ static int sa11x0_dma_remove(struct platform_device *pdev)
 	struct sa11x0_dma_dev *d = platform_get_drvdata(pdev);
 	unsigned pch;
 
-	dma_async_device_unregister(&d->slave);
-
 	sa11x0_dma_free_channels(&d->slave);
 	for (pch = 0; pch < NR_PHY_CHAN; pch++)
 		sa11x0_dma_free_irq(pdev, pch, &d->phy[pch]);

^ permalink raw reply related

* [22/46] dmaengine: sudmac: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

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

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/sh/sudmac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/sh/sudmac.c b/drivers/dma/sh/sudmac.c
index 69b9564dc9d9..f861067edef4 100644
--- a/drivers/dma/sh/sudmac.c
+++ b/drivers/dma/sh/sudmac.c
@@ -376,7 +376,7 @@ static int sudmac_probe(struct platform_device *pdev)
 			goto chan_probe_err;
 	}
 
-	err = dma_async_device_register(&su_dev->shdma_dev.dma_dev);
+	err = dmaenginem_async_device_register(&su_dev->shdma_dev.dma_dev);
 	if (err < 0)
 		goto chan_probe_err;
 
@@ -393,9 +393,7 @@ static int sudmac_probe(struct platform_device *pdev)
 static int sudmac_remove(struct platform_device *pdev)
 {
 	struct sudmac_device *su_dev = platform_get_drvdata(pdev);
-	struct dma_device *dma_dev = &su_dev->shdma_dev.dma_dev;
 
-	dma_async_device_unregister(dma_dev);
 	sudmac_chan_remove(su_dev);
 	shdma_cleanup(&su_dev->shdma_dev);
 

^ permalink raw reply related

* [21/46] dmaengine: bam_dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

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

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

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 1617715aa6e0..d164892a8aa4 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1332,7 +1332,7 @@ static int bam_dma_probe(struct platform_device *pdev)
 	bdev->common.device_tx_status = bam_tx_status;
 	bdev->common.dev = bdev->dev;
 
-	ret = dma_async_device_register(&bdev->common);
+	ret = dmaenginem_async_device_register(&bdev->common);
 	if (ret) {
 		dev_err(bdev->dev, "failed to register dma async device\n");
 		goto err_bam_channel_exit;
@@ -1341,7 +1341,7 @@ static int bam_dma_probe(struct platform_device *pdev)
 	ret = of_dma_controller_register(pdev->dev.of_node, bam_dma_xlate,
 					&bdev->common);
 	if (ret)
-		goto err_unregister_dma;
+		goto err_bam_channel_exit;
 
 	if (bdev->controlled_remotely) {
 		pm_runtime_disable(&pdev->dev);
@@ -1357,8 +1357,6 @@ static int bam_dma_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_unregister_dma:
-	dma_async_device_unregister(&bdev->common);
 err_bam_channel_exit:
 	for (i = 0; i < bdev->num_channels; i++)
 		tasklet_kill(&bdev->channels[i].vc.task);
@@ -1378,7 +1376,6 @@ static int bam_dma_remove(struct platform_device *pdev)
 	pm_runtime_force_suspend(&pdev->dev);
 
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&bdev->common);
 
 	/* mask all interrupts for this execution environment */
 	writel_relaxed(0, bam_addr(bdev, 0,  BAM_IRQ_SRCS_MSK_EE));

^ permalink raw reply related

* [20/46] dmaengine: sirf-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

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@iluvatar.ai>
---
 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);

^ permalink raw reply related

* [19/46] dmaengine: sprd-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

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

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

diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 55df0d41355b..d06459d1f96f 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -943,7 +943,7 @@ static int sprd_dma_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto err_rpm;
 
-	ret = dma_async_device_register(&sdev->dma_dev);
+	ret = dmaenginem_async_device_register(&sdev->dma_dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "register dma device failed:%d\n", ret);
 		goto err_register;
@@ -953,13 +953,11 @@ static int sprd_dma_probe(struct platform_device *pdev)
 	ret = of_dma_controller_register(np, of_dma_simple_xlate,
 					 &sprd_dma_info);
 	if (ret)
-		goto err_of_register;
+		goto err_register;
 
 	pm_runtime_put(&pdev->dev);
 	return 0;
 
-err_of_register:
-	dma_async_device_unregister(&sdev->dma_dev);
 err_register:
 	pm_runtime_put_noidle(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
@@ -989,7 +987,6 @@ static int sprd_dma_remove(struct platform_device *pdev)
 	}
 
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&sdev->dma_dev);
 	sprd_dma_disable(sdev);
 
 	pm_runtime_put_noidle(&pdev->dev);

^ permalink raw reply related

* [18/46] dmaengine: stm32-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/stm32-dma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 379e8d534e61..6bbb3fab4f13 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -1295,7 +1295,7 @@ static int stm32_dma_probe(struct platform_device *pdev)
 		vchan_init(&chan->vchan, dd);
 	}
 
-	ret = dma_async_device_register(dd);
+	ret = dmaenginem_async_device_register(dd);
 	if (ret)
 		return ret;
 
@@ -1334,7 +1334,6 @@ static int stm32_dma_probe(struct platform_device *pdev)
 	return 0;
 
 err_unregister:
-	dma_async_device_unregister(dd);
 
 	return ret;
 }

^ permalink raw reply related

* [17/46] dmaengine: stm32-mdma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/stm32-mdma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
index 06dd1725375e..390e4cae0e1a 100644
--- a/drivers/dma/stm32-mdma.c
+++ b/drivers/dma/stm32-mdma.c
@@ -1656,7 +1656,7 @@ static int stm32_mdma_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	ret = dma_async_device_register(dd);
+	ret = dmaenginem_async_device_register(dd);
 	if (ret)
 		return ret;
 
@@ -1674,8 +1674,6 @@ static int stm32_mdma_probe(struct platform_device *pdev)
 	return 0;
 
 err_unregister:
-	dma_async_device_unregister(dd);
-
 	return ret;
 }
 

^ permalink raw reply related

* [16/46] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.
	remove label unregister_slave, unregister_memcpy

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

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index f4edfc56f34e..5e328bd10c27 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2839,7 +2839,7 @@ static int __init d40_dmaengine_init(struct d40_base *base,
 
 	d40_ops_init(base, &base->dma_slave);
 
-	err = dma_async_device_register(&base->dma_slave);
+	err = dmaenginem_async_device_register(&base->dma_slave);
 
 	if (err) {
 		d40_err(base->dev, "Failed to register slave channels\n");
@@ -2854,12 +2854,12 @@ static int __init d40_dmaengine_init(struct d40_base *base,
 
 	d40_ops_init(base, &base->dma_memcpy);
 
-	err = dma_async_device_register(&base->dma_memcpy);
+	err = dmaenginem_async_device_register(&base->dma_memcpy);
 
 	if (err) {
 		d40_err(base->dev,
 			"Failed to register memcpy only channels\n");
-		goto unregister_slave;
+		goto exit;
 	}
 
 	d40_chan_init(base, &base->dma_both, base->phy_chans,
@@ -2871,18 +2871,14 @@ static int __init d40_dmaengine_init(struct d40_base *base,
 	dma_cap_set(DMA_CYCLIC, base->dma_slave.cap_mask);
 
 	d40_ops_init(base, &base->dma_both);
-	err = dma_async_device_register(&base->dma_both);
+	err = dmaenginem_async_device_register(&base->dma_both);
 
 	if (err) {
 		d40_err(base->dev,
 			"Failed to register logical and physical capable channels\n");
-		goto unregister_memcpy;
+		goto exit;
 	}
 	return 0;
- unregister_memcpy:
-	dma_async_device_unregister(&base->dma_memcpy);
- unregister_slave:
-	dma_async_device_unregister(&base->dma_slave);
  exit:
 	return err;
 }

^ permalink raw reply related

* [15/46] dmaengine: s3c24xx-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

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

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/s3c24xx-dma.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/s3c24xx-dma.c b/drivers/dma/s3c24xx-dma.c
index 64744eb88720..1d820c0cd14b 100644
--- a/drivers/dma/s3c24xx-dma.c
+++ b/drivers/dma/s3c24xx-dma.c
@@ -1330,7 +1330,7 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
 		goto err_slave;
 	}
 
-	ret = dma_async_device_register(&s3cdma->memcpy);
+	ret = dmaenginem_async_device_register(&s3cdma->memcpy);
 	if (ret) {
 		dev_warn(&pdev->dev,
 			"%s failed to register memcpy as an async device - %d\n",
@@ -1338,12 +1338,12 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
 		goto err_memcpy_reg;
 	}
 
-	ret = dma_async_device_register(&s3cdma->slave);
+	ret = dmaenginem_async_device_register(&s3cdma->slave);
 	if (ret) {
 		dev_warn(&pdev->dev,
 			"%s failed to register slave as an async device - %d\n",
 			__func__, ret);
-		goto err_slave_reg;
+		goto err_memcpy_reg;
 	}
 
 	platform_set_drvdata(pdev, s3cdma);
@@ -1352,8 +1352,6 @@ static int s3c24xx_dma_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_slave_reg:
-	dma_async_device_unregister(&s3cdma->memcpy);
 err_memcpy_reg:
 	s3c24xx_dma_free_virtual_channels(&s3cdma->slave);
 err_slave:
@@ -1388,9 +1386,6 @@ static int s3c24xx_dma_remove(struct platform_device *pdev)
 	struct soc_data *sdata = s3c24xx_dma_get_soc_data(pdev);
 	int i;
 
-	dma_async_device_unregister(&s3cdma->slave);
-	dma_async_device_unregister(&s3cdma->memcpy);
-
 	s3c24xx_dma_free_irq(pdev, s3cdma);
 
 	s3c24xx_dma_free_virtual_channels(&s3cdma->slave);

^ permalink raw reply related

* [14/46] dmaengine: coh901318: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
   remove dma_async_device_unregister
   remove label err_register_of_dma,err_register_memcpy

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/coh901318.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c
index da74fd74636b..ff29f2f6ce3b 100644
--- a/drivers/dma/coh901318.c
+++ b/drivers/dma/coh901318.c
@@ -2690,7 +2690,7 @@ static int __init coh901318_probe(struct platform_device *pdev)
 	base->dma_slave.device_terminate_all = coh901318_terminate_all;
 	base->dma_slave.dev = &pdev->dev;
 
-	err = dma_async_device_register(&base->dma_slave);
+	err = dmaenginem_async_device_register(&base->dma_slave);
 
 	if (err)
 		goto err_register_slave;
@@ -2717,15 +2717,15 @@ static int __init coh901318_probe(struct platform_device *pdev)
 	 * i.e. 2^2
 	 */
 	base->dma_memcpy.copy_align = DMAENGINE_ALIGN_4_BYTES;
-	err = dma_async_device_register(&base->dma_memcpy);
+	err = dmaenginem_async_device_register(&base->dma_memcpy);
 
 	if (err)
-		goto err_register_memcpy;
+		goto err_register_slave;
 
 	err = of_dma_controller_register(pdev->dev.of_node, coh901318_xlate,
 					 base);
 	if (err)
-		goto err_register_of_dma;
+		goto err_register_slave;
 
 	platform_set_drvdata(pdev, base);
 	dev_info(&pdev->dev, "Initialized COH901318 DMA on virtual base 0x%p\n",
@@ -2733,10 +2733,6 @@ static int __init coh901318_probe(struct platform_device *pdev)
 
 	return err;
 
- err_register_of_dma:
-	dma_async_device_unregister(&base->dma_memcpy);
- err_register_memcpy:
-	dma_async_device_unregister(&base->dma_slave);
  err_register_slave:
 	coh901318_pool_destroy(&base->pool);
 	return err;
@@ -2767,8 +2763,6 @@ static int coh901318_remove(struct platform_device *pdev)
 	coh901318_base_remove(base, dma_memcpy_channels);
 
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&base->dma_memcpy);
-	dma_async_device_unregister(&base->dma_slave);
 	coh901318_pool_destroy(&base->pool);
 	return 0;
 }

^ permalink raw reply related

* [13/46] dmaengine: sun4i-dma: use dmaenginem_async_device_register to simplify the code
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
   remove dma_async_device_unregister
   remove label err_dma_unregister

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

diff --git a/drivers/dma/sun4i-dma.c b/drivers/dma/sun4i-dma.c
index f4ed3f17607c..c80a59c1fc38 100644
--- a/drivers/dma/sun4i-dma.c
+++ b/drivers/dma/sun4i-dma.c
@@ -1228,7 +1228,7 @@ static int sun4i_dma_probe(struct platform_device *pdev)
 		goto err_clk_disable;
 	}
 
-	ret = dma_async_device_register(&priv->slave);
+	ret = dmaenginem_async_device_register(&priv->slave);
 	if (ret) {
 		dev_warn(&pdev->dev, "Failed to register DMA engine device\n");
 		goto err_clk_disable;
@@ -1238,15 +1238,13 @@ static int sun4i_dma_probe(struct platform_device *pdev)
 					 priv);
 	if (ret) {
 		dev_err(&pdev->dev, "of_dma_controller_register failed\n");
-		goto err_dma_unregister;
+		goto err_clk_disable;
 	}
 
 	dev_dbg(&pdev->dev, "Successfully probed SUN4I_DMA\n");
 
 	return 0;
 
-err_dma_unregister:
-	dma_async_device_unregister(&priv->slave);
 err_clk_disable:
 	clk_disable_unprepare(priv->clk);
 	return ret;
@@ -1260,7 +1258,6 @@ static int sun4i_dma_remove(struct platform_device *pdev)
 	disable_irq(priv->irq);
 
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&priv->slave);
 
 	clk_disable_unprepare(priv->clk);
 

^ permalink raw reply related

* [12/46] dmaengine: sun6i-dma: use helper dmaenginem_async_device_register
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
   remove dma_async_device_unregister
   remove the label err_dma_unregister

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

diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 0cd13f17fc11..419d6090f9e1 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -1319,7 +1319,7 @@ static int sun6i_dma_probe(struct platform_device *pdev)
 		goto err_clk_disable;
 	}
 
-	ret = dma_async_device_register(&sdc->slave);
+	ret = dmaenginem_async_device_register(&sdc->slave);
 	if (ret) {
 		dev_warn(&pdev->dev, "Failed to register DMA engine device\n");
 		goto err_irq_disable;
@@ -1329,7 +1329,7 @@ static int sun6i_dma_probe(struct platform_device *pdev)
 					 sdc);
 	if (ret) {
 		dev_err(&pdev->dev, "of_dma_controller_register failed\n");
-		goto err_dma_unregister;
+		goto err_irq_disable;
 	}
 
 	if (sdc->cfg->clock_autogate_enable)
@@ -1337,8 +1337,6 @@ static int sun6i_dma_probe(struct platform_device *pdev)
 
 	return 0;
 
-err_dma_unregister:
-	dma_async_device_unregister(&sdc->slave);
 err_irq_disable:
 	sun6i_kill_tasklet(sdc);
 err_clk_disable:
@@ -1355,7 +1353,6 @@ static int sun6i_dma_remove(struct platform_device *pdev)
 	struct sun6i_dma_dev *sdc = platform_get_drvdata(pdev);
 
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&sdc->slave);
 
 	sun6i_kill_tasklet(sdc);
 

^ permalink raw reply related

* [11/46] dmaengine: tegra20-apb-dma: use helper dmaenginem_async_device_register
From: Huang Shijie @ 2018-08-03  7:19 UTC (permalink / raw)
  To: vkoul
  Cc: dmaengine, linux-kernel, dave.jiang, radhey.shyam.pandey,
	appana.durga.rao, jmkrzyszt, gomonovych, peter.ujfalusi, keescook,
	horms+renesas, geert+renesas, shawnguo, baoyou.xie, michal.simek,
	baohua, ludovic.desroches, linus.walleij, david.brown,
	Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
   remove dma_async_device_unregister
   remove the label err_unregister_dma_dev

Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
---
 drivers/dma/tegra20-apb-dma.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index 9a558e30c461..9f6f51abbeef 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1444,7 +1444,7 @@ static int tegra_dma_probe(struct platform_device *pdev)
 	tdma->dma_dev.device_tx_status = tegra_dma_tx_status;
 	tdma->dma_dev.device_issue_pending = tegra_dma_issue_pending;
 
-	ret = dma_async_device_register(&tdma->dma_dev);
+	ret = dmaenginem_async_device_register(&tdma->dma_dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev,
 			"Tegra20 APB DMA driver registration failed %d\n", ret);
@@ -1456,15 +1456,13 @@ static int tegra_dma_probe(struct platform_device *pdev)
 	if (ret < 0) {
 		dev_err(&pdev->dev,
 			"Tegra20 APB DMA OF registration failed %d\n", ret);
-		goto err_unregister_dma_dev;
+		goto err_irq;
 	}
 
 	dev_info(&pdev->dev, "Tegra20 APB DMA driver register %d channels\n",
 			cdata->nr_channels);
 	return 0;
 
-err_unregister_dma_dev:
-	dma_async_device_unregister(&tdma->dma_dev);
 err_irq:
 	while (--i >= 0) {
 		struct tegra_dma_channel *tdc = &tdma->channels[i];
@@ -1485,8 +1483,6 @@ static int tegra_dma_remove(struct platform_device *pdev)
 	int i;
 	struct tegra_dma_channel *tdc;
 
-	dma_async_device_unregister(&tdma->dma_dev);
-
 	for (i = 0; i < tdma->chip_data->nr_channels; ++i) {
 		tdc = &tdma->channels[i];
 		free_irq(tdc->irq, tdc);

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox