All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/9] dmaengine: Use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 Huang Shijie
  2018-08-29 16:14 ` Vinod Koul
  0 siblings, 1 reply; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

Using the dmaenginem_async_device_register to simplify code for these DMA drivers:
    1.) dma_async_device_unregister is the last action of drv->remove().
    2.) the dma driver does not have the ->remove().

v1 --> v2:
   Drop the patched which call dma_async_device_unregister() are not
   the last action.

Huang Shijie (9):
  dmaengine: dw-axi-dmac: use dmaenginem_async_device_register to
    simplify the code
  dmaengine: stm32-mdma: use dmaenginem_async_device_register to
    simplify the code
  dmaengine: st_fdma: use dmaenginem_async_device_register to simplify
    the code
  dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify
    the code
  dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify
    the code
  dmaengine: dma-jz4780: use dmaenginem_async_device_register to
    simplify the code
  dmaengine: pxa_dma: use dmaenginem_async_device_register to simplify
    the code
  dmaengine: mxs-dma: use dmaenginem_async_device_register to simplify
    the code
  dmaengine: add COMPILE_TEST for the drivers

 drivers/dma/Kconfig                            |  4 ++--
 drivers/dma/dma-jz4780.c                       |  8 ++------
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c |  4 +---
 drivers/dma/mmp_tdma.c                         |  7 ++-----
 drivers/dma/mxs-dma.c                          |  3 +--
 drivers/dma/pxa_dma.c                          |  3 +--
 drivers/dma/st_fdma.c                          |  4 +---
 drivers/dma/ste_dma40.c                        | 14 +++++---------
 drivers/dma/stm32-mdma.c                       |  4 +---
 9 files changed, 16 insertions(+), 35 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [v2,1/9] dmaengine: dw-axi-dmac: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, 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/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index c4eb55e3011c..b2ac1d2c5b86 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -934,7 +934,7 @@ static int dw_probe(struct platform_device *pdev)
 
 	pm_runtime_put(chip->dev);
 
-	ret = dma_async_device_register(&dw->dma);
+	ret = dmaenginem_async_device_register(&dw->dma);
 	if (ret)
 		goto err_pm_disable;
 
@@ -977,8 +977,6 @@ static int dw_remove(struct platform_device *pdev)
 		tasklet_kill(&chan->vc.task);
 	}
 
-	dma_async_device_unregister(&dw->dma);
-
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 1/9] dmaengine: dw-axi-dmac: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

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

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index c4eb55e3011c..b2ac1d2c5b86 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -934,7 +934,7 @@ static int dw_probe(struct platform_device *pdev)
 
 	pm_runtime_put(chip->dev);
 
-	ret = dma_async_device_register(&dw->dma);
+	ret = dmaenginem_async_device_register(&dw->dma);
 	if (ret)
 		goto err_pm_disable;
 
@@ -977,8 +977,6 @@ static int dw_remove(struct platform_device *pdev)
 		tasklet_kill(&chan->vc.task);
 	}
 
-	dma_async_device_unregister(&dw->dma);
-
 	return 0;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,2/9] dmaengine: stm32-mdma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, Huang Shijie

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Acked-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
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	[flat|nested] 34+ messages in thread

* [PATCH v2 2/9] dmaengine: stm32-mdma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

Acked-by: Pierre-Yves MORDRET <pierre-yves.mordret@st.com>
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;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,3/9] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, 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/st_fdma.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
index bfb79bd0c6de..7eafccd4f7f5 100644
--- a/drivers/dma/st_fdma.c
+++ b/drivers/dma/st_fdma.c
@@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev)
 	fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
 	fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
 
-	ret = dma_async_device_register(&fdev->dma_device);
+	ret = dmaenginem_async_device_register(&fdev->dma_device);
 	if (ret) {
 		dev_err(&pdev->dev,
 			"Failed to register DMA device (%d)\n", ret);
@@ -852,7 +852,6 @@ static int st_fdma_probe(struct platform_device *pdev)
 	return 0;
 
 err_dma_dev:
-	dma_async_device_unregister(&fdev->dma_device);
 err_rproc:
 	st_fdma_free(fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
@@ -867,7 +866,6 @@ static int st_fdma_remove(struct platform_device *pdev)
 	devm_free_irq(&pdev->dev, fdev->irq, fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&fdev->dma_device);
 
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 3/9] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

Use dmaenginem_async_device_register to simplify the code:
	remove dma_async_device_unregister.

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

diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
index bfb79bd0c6de..7eafccd4f7f5 100644
--- a/drivers/dma/st_fdma.c
+++ b/drivers/dma/st_fdma.c
@@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev)
 	fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
 	fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
 
-	ret = dma_async_device_register(&fdev->dma_device);
+	ret = dmaenginem_async_device_register(&fdev->dma_device);
 	if (ret) {
 		dev_err(&pdev->dev,
 			"Failed to register DMA device (%d)\n", ret);
@@ -852,7 +852,6 @@ static int st_fdma_probe(struct platform_device *pdev)
 	return 0;
 
 err_dma_dev:
-	dma_async_device_unregister(&fdev->dma_device);
 err_rproc:
 	st_fdma_free(fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
@@ -867,7 +866,6 @@ static int st_fdma_remove(struct platform_device *pdev)
 	devm_free_irq(&pdev->dev, fdev->irq, fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&fdev->dma_device);
 
 	return 0;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,4/9] dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, 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	[flat|nested] 34+ messages in thread

* [PATCH v2 4/9] dmaengine: mmp_tdma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

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;
 		}
 	}
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, 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	[flat|nested] 34+ messages in thread

* [PATCH v2 5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

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;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,6/9] dmaengine: dma-jz4780: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, Huang Shijie

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

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

diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index 85820a2d69d4..b2a244902bc5 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -847,7 +847,7 @@ static int jz4780_dma_probe(struct platform_device *pdev)
 		jzchan->vchan.desc_free = jz4780_dma_desc_free;
 	}
 
-	ret = dma_async_device_register(dd);
+	ret = dmaenginem_async_device_register(dd);
 	if (ret) {
 		dev_err(dev, "failed to register device\n");
 		goto err_disable_clk;
@@ -858,15 +858,12 @@ static int jz4780_dma_probe(struct platform_device *pdev)
 					 jzdma);
 	if (ret) {
 		dev_err(dev, "failed to register OF DMA controller\n");
-		goto err_unregister_dev;
+		goto err_disable_clk;
 	}
 
 	dev_info(dev, "JZ4780 DMA controller initialised\n");
 	return 0;
 
-err_unregister_dev:
-	dma_async_device_unregister(dd);
-
 err_disable_clk:
 	clk_disable_unprepare(jzdma->clk);
 
@@ -887,7 +884,6 @@ static int jz4780_dma_remove(struct platform_device *pdev)
 	for (i = 0; i < JZ_DMA_NR_CHANNELS; i++)
 		tasklet_kill(&jzdma->chan[i].vchan.task);
 
-	dma_async_device_unregister(&jzdma->dma_device);
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 6/9] dmaengine: dma-jz4780: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index 85820a2d69d4..b2a244902bc5 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -847,7 +847,7 @@ static int jz4780_dma_probe(struct platform_device *pdev)
 		jzchan->vchan.desc_free = jz4780_dma_desc_free;
 	}
 
-	ret = dma_async_device_register(dd);
+	ret = dmaenginem_async_device_register(dd);
 	if (ret) {
 		dev_err(dev, "failed to register device\n");
 		goto err_disable_clk;
@@ -858,15 +858,12 @@ static int jz4780_dma_probe(struct platform_device *pdev)
 					 jzdma);
 	if (ret) {
 		dev_err(dev, "failed to register OF DMA controller\n");
-		goto err_unregister_dev;
+		goto err_disable_clk;
 	}
 
 	dev_info(dev, "JZ4780 DMA controller initialised\n");
 	return 0;
 
-err_unregister_dev:
-	dma_async_device_unregister(dd);
-
 err_disable_clk:
 	clk_disable_unprepare(jzdma->clk);
 
@@ -887,7 +884,6 @@ static int jz4780_dma_remove(struct platform_device *pdev)
 	for (i = 0; i < JZ_DMA_NR_CHANNELS; i++)
 		tasklet_kill(&jzdma->chan[i].vchan.task);
 
-	dma_async_device_unregister(&jzdma->dma_device);
 	return 0;
 }
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,7/9] dmaengine: pxa_dma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, 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	[flat|nested] 34+ messages in thread

* [PATCH v2 7/9] dmaengine: pxa_dma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

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)
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,8/9] dmaengine: mxs-dma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, 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	[flat|nested] 34+ messages in thread

* [PATCH v2 8/9] dmaengine: mxs-dma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

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");
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,9/9] dmaengine: add COMPILE_TEST for the drivers
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, Huang Shijie

We can do the compiling test with COMPILE_TEST.
This patch adds the COMPILE_TEST for the drivers.

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

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index d4a4230a7942..1f0dceb055d8 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -439,7 +439,7 @@ config PL330_DMA
 
 config PXA_DMA
 	bool "PXA DMA support"
-	depends on (ARCH_MMP || ARCH_PXA)
+	depends on (ARCH_MMP || ARCH_PXA || COMPILE_TEST)
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
 	help
@@ -457,7 +457,7 @@ config SIRF_DMA
 
 config STE_DMA40
 	bool "ST-Ericsson DMA40 support"
-	depends on ARCH_U8500
+	depends on ARCH_U8500 || COMPILE_TEST
 	select DMA_ENGINE
 	help
 	  Support for ST-Ericsson DMA40 controller

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH v2 9/9] dmaengine: add COMPILE_TEST for the drivers
@ 2018-08-06  8:52 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

We can do the compiling test with COMPILE_TEST.
This patch adds the COMPILE_TEST for the drivers.

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

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index d4a4230a7942..1f0dceb055d8 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -439,7 +439,7 @@ config PL330_DMA
 
 config PXA_DMA
 	bool "PXA DMA support"
-	depends on (ARCH_MMP || ARCH_PXA)
+	depends on (ARCH_MMP || ARCH_PXA || COMPILE_TEST)
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
 	help
@@ -457,7 +457,7 @@ config SIRF_DMA
 
 config STE_DMA40
 	bool "ST-Ericsson DMA40 support"
-	depends on ARCH_U8500
+	depends on ARCH_U8500 || COMPILE_TEST
 	select DMA_ENGINE
 	help
 	  Support for ST-Ericsson DMA40 controller
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,3/9] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 ` [PATCH v2 3/9] " Huang Shijie
@ 2018-08-06  9:03 ` Daniel Mack
  -1 siblings, 0 replies; 34+ messages in thread
From: Daniel Mack @ 2018-08-06  9:03 UTC (permalink / raw)
  To: Huang Shijie, vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, haojian.zhuang, robert.jarzmik,
	patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel

On Monday, August 06, 2018 10:52 AM, Huang Shijie wrote:
> Use dmaenginem_async_device_register to simplify the code:
> 	remove dma_async_device_unregister.
> 
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
> ---
>   drivers/dma/st_fdma.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
> index bfb79bd0c6de..7eafccd4f7f5 100644
> --- a/drivers/dma/st_fdma.c
> +++ b/drivers/dma/st_fdma.c
> @@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev)
>   	fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
>   	fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
>   
> -	ret = dma_async_device_register(&fdev->dma_device);
> +	ret = dmaenginem_async_device_register(&fdev->dma_device);
>   	if (ret) {
>   		dev_err(&pdev->dev,
>   			"Failed to register DMA device (%d)\n", ret);
> @@ -852,7 +852,6 @@ static int st_fdma_probe(struct platform_device *pdev)
>   	return 0;
>   
>   err_dma_dev:
> -	dma_async_device_unregister(&fdev->dma_device);

I guess the jump label can go away too?


Thanks,
Daniel
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 3/9] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  9:03 ` Daniel Mack
  0 siblings, 0 replies; 34+ messages in thread
From: Daniel Mack @ 2018-08-06  9:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, August 06, 2018 10:52 AM, Huang Shijie wrote:
> Use dmaenginem_async_device_register to simplify the code:
> 	remove dma_async_device_unregister.
> 
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
> ---
>   drivers/dma/st_fdma.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
> index bfb79bd0c6de..7eafccd4f7f5 100644
> --- a/drivers/dma/st_fdma.c
> +++ b/drivers/dma/st_fdma.c
> @@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev)
>   	fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
>   	fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
>   
> -	ret = dma_async_device_register(&fdev->dma_device);
> +	ret = dmaenginem_async_device_register(&fdev->dma_device);
>   	if (ret) {
>   		dev_err(&pdev->dev,
>   			"Failed to register DMA device (%d)\n", ret);
> @@ -852,7 +852,6 @@ static int st_fdma_probe(struct platform_device *pdev)
>   	return 0;
>   
>   err_dma_dev:
> -	dma_async_device_unregister(&fdev->dma_device);

I guess the jump label can go away too?


Thanks,
Daniel

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [v2,3/9] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  9:03 ` [PATCH v2 3/9] " Daniel Mack
@ 2018-08-06  9:22 ` Huang Shijie
  -1 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  9:22 UTC (permalink / raw)
  To: Daniel Mack
  Cc: vkoul, dan.j.williams, Zubair.Kakakhel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel

On Mon, Aug 06, 2018 at 11:03:51AM +0200, Daniel Mack wrote:
> > -	ret = dma_async_device_register(&fdev->dma_device);
> > +	ret = dmaenginem_async_device_register(&fdev->dma_device);
> >   	if (ret) {
> >   		dev_err(&pdev->dev,
> >   			"Failed to register DMA device (%d)\n", ret);
> > @@ -852,7 +852,6 @@ static int st_fdma_probe(struct platform_device *pdev)
> >   	return 0;
> >   err_dma_dev:
> > -	dma_async_device_unregister(&fdev->dma_device);
> 
> I guess the jump label can go away too?
Yes. 

We can remove the err_dma_dev too.

Thanks
Huang Shijie
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 3/9] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  9:22 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  9:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 06, 2018 at 11:03:51AM +0200, Daniel Mack wrote:
> > -	ret = dma_async_device_register(&fdev->dma_device);
> > +	ret = dmaenginem_async_device_register(&fdev->dma_device);
> >   	if (ret) {
> >   		dev_err(&pdev->dev,
> >   			"Failed to register DMA device (%d)\n", ret);
> > @@ -852,7 +852,6 @@ static int st_fdma_probe(struct platform_device *pdev)
> >   	return 0;
> >   err_dma_dev:
> > -	dma_async_device_unregister(&fdev->dma_device);
> 
> I guess the jump label can go away too?
Yes. 

We can remove the err_dma_dev too.

Thanks
Huang Shijie

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [V2,fix] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 ` [PATCH v2 3/9] " Huang Shijie
@ 2018-08-06  9:43 ` Huang Shijie
  -1 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  9:43 UTC (permalink / raw)
  To: vkoul
  Cc: dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	robert.jarzmik, patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel, Huang Shijie

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

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

diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
index bfb79bd0c6de..07c20aa2e955 100644
--- a/drivers/dma/st_fdma.c
+++ b/drivers/dma/st_fdma.c
@@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev)
 	fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
 	fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
 
-	ret = dma_async_device_register(&fdev->dma_device);
+	ret = dmaenginem_async_device_register(&fdev->dma_device);
 	if (ret) {
 		dev_err(&pdev->dev,
 			"Failed to register DMA device (%d)\n", ret);
@@ -844,15 +844,13 @@ static int st_fdma_probe(struct platform_device *pdev)
 	if (ret) {
 		dev_err(&pdev->dev,
 			"Failed to register controller (%d)\n", ret);
-		goto err_dma_dev;
+		goto err_rproc;
 	}
 
 	dev_info(&pdev->dev, "ST FDMA engine driver, irq:%d\n", fdev->irq);
 
 	return 0;
 
-err_dma_dev:
-	dma_async_device_unregister(&fdev->dma_device);
 err_rproc:
 	st_fdma_free(fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
@@ -867,7 +865,6 @@ static int st_fdma_remove(struct platform_device *pdev)
 	devm_free_irq(&pdev->dev, fdev->irq, fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&fdev->dma_device);
 
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [PATCH V2 fix] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06  9:43 ` Huang Shijie
  0 siblings, 0 replies; 34+ messages in thread
From: Huang Shijie @ 2018-08-06  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
index bfb79bd0c6de..07c20aa2e955 100644
--- a/drivers/dma/st_fdma.c
+++ b/drivers/dma/st_fdma.c
@@ -833,7 +833,7 @@ static int st_fdma_probe(struct platform_device *pdev)
 	fdev->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
 	fdev->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_BURST;
 
-	ret = dma_async_device_register(&fdev->dma_device);
+	ret = dmaenginem_async_device_register(&fdev->dma_device);
 	if (ret) {
 		dev_err(&pdev->dev,
 			"Failed to register DMA device (%d)\n", ret);
@@ -844,15 +844,13 @@ static int st_fdma_probe(struct platform_device *pdev)
 	if (ret) {
 		dev_err(&pdev->dev,
 			"Failed to register controller (%d)\n", ret);
-		goto err_dma_dev;
+		goto err_rproc;
 	}
 
 	dev_info(&pdev->dev, "ST FDMA engine driver, irq:%d\n", fdev->irq);
 
 	return 0;
 
-err_dma_dev:
-	dma_async_device_unregister(&fdev->dma_device);
 err_rproc:
 	st_fdma_free(fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
@@ -867,7 +865,6 @@ static int st_fdma_remove(struct platform_device *pdev)
 	devm_free_irq(&pdev->dev, fdev->irq, fdev);
 	st_slim_rproc_put(fdev->slim_rproc);
 	of_dma_controller_free(pdev->dev.of_node);
-	dma_async_device_unregister(&fdev->dma_device);
 
 	return 0;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [v2,5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 ` [PATCH v2 5/9] " Huang Shijie
@ 2018-08-06 10:34 ` Linus Walleij
  -1 siblings, 0 replies; 34+ messages in thread
From: Linus Walleij @ 2018-08-06 10:34 UTC (permalink / raw)
  To: sjhuang
  Cc: vkoul, Dan Williams, Zubair Lutfullah Kakakhel, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Patrice CHOTARD, Maxime Coquelin,
	Alexandre TORGUE, Eugeniy.Paltsev, Colin King, dmaengine,
	Linux ARM

On Mon, Aug 6, 2018 at 10:53 AM Huang Shijie <sjhuang@iluvatar.ai> wrote:

> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code
@ 2018-08-06 10:34 ` Linus Walleij
  0 siblings, 0 replies; 34+ messages in thread
From: Linus Walleij @ 2018-08-06 10:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 6, 2018 at 10:53 AM Huang Shijie <sjhuang@iluvatar.ai> wrote:

> 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>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [v2,9/9] dmaengine: add COMPILE_TEST for the drivers
  2018-08-06  8:52 ` [PATCH v2 9/9] " Huang Shijie
@ 2018-08-06 10:35 ` Linus Walleij
  -1 siblings, 0 replies; 34+ messages in thread
From: Linus Walleij @ 2018-08-06 10:35 UTC (permalink / raw)
  To: sjhuang
  Cc: vkoul, Dan Williams, Zubair Lutfullah Kakakhel, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Patrice CHOTARD, Maxime Coquelin,
	Alexandre TORGUE, Eugeniy.Paltsev, Colin King, dmaengine,
	Linux ARM

On Mon, Aug 6, 2018 at 10:53 AM Huang Shijie <sjhuang@iluvatar.ai> wrote:

> We can do the compiling test with COMPILE_TEST.
> This patch adds the COMPILE_TEST for the drivers.
>
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 9/9] dmaengine: add COMPILE_TEST for the drivers
@ 2018-08-06 10:35 ` Linus Walleij
  0 siblings, 0 replies; 34+ messages in thread
From: Linus Walleij @ 2018-08-06 10:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Aug 6, 2018 at 10:53 AM Huang Shijie <sjhuang@iluvatar.ai> wrote:

> We can do the compiling test with COMPILE_TEST.
> This patch adds the COMPILE_TEST for the drivers.
>
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>

Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [v2,9/9] dmaengine: add COMPILE_TEST for the drivers
  2018-08-06  8:52 ` [PATCH v2 9/9] " Huang Shijie
@ 2018-08-07  6:32 ` Robert Jarzmik
  -1 siblings, 0 replies; 34+ messages in thread
From: Robert Jarzmik @ 2018-08-07  6:32 UTC (permalink / raw)
  To: Huang Shijie
  Cc: vkoul, dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel

Huang Shijie <sjhuang@iluvatar.ai> writes:

> We can do the compiling test with COMPILE_TEST.
> This patch adds the COMPILE_TEST for the drivers.
>
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
For pxa :
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.
---
Robert
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 9/9] dmaengine: add COMPILE_TEST for the drivers
@ 2018-08-07  6:32 ` Robert Jarzmik
  0 siblings, 0 replies; 34+ messages in thread
From: Robert Jarzmik @ 2018-08-07  6:32 UTC (permalink / raw)
  To: linux-arm-kernel

Huang Shijie <sjhuang@iluvatar.ai> writes:

> We can do the compiling test with COMPILE_TEST.
> This patch adds the COMPILE_TEST for the drivers.
>
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
For pxa :
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.

--
Robert

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [v2,7/9] dmaengine: pxa_dma: use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 ` [PATCH v2 7/9] " Huang Shijie
@ 2018-08-07  6:37 ` Robert Jarzmik
  -1 siblings, 0 replies; 34+ messages in thread
From: Robert Jarzmik @ 2018-08-07  6:37 UTC (permalink / raw)
  To: Huang Shijie
  Cc: vkoul, dan.j.williams, Zubair.Kakakhel, daniel, haojian.zhuang,
	patrice.chotard, linus.walleij, mcoquelin.stm32,
	alexandre.torgue, Eugeniy.Paltsev, colin.king, dmaengine,
	linux-arm-kernel

Huang Shijie <sjhuang@iluvatar.ai> writes:

> Use dmaenginem_async_device_register to simplify the code:
> 	remove dma_async_device_unregister.
>
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 7/9] dmaengine: pxa_dma: use dmaenginem_async_device_register to simplify the code
@ 2018-08-07  6:37 ` Robert Jarzmik
  0 siblings, 0 replies; 34+ messages in thread
From: Robert Jarzmik @ 2018-08-07  6:37 UTC (permalink / raw)
  To: linux-arm-kernel

Huang Shijie <sjhuang@iluvatar.ai> writes:

> Use dmaenginem_async_device_register to simplify the code:
> 	remove dma_async_device_unregister.
>
> Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

-- 
Robert

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [PATCH v2 0/9] dmaengine: Use dmaenginem_async_device_register to simplify the code
  2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
@ 2018-08-29 16:14 ` Vinod Koul
  0 siblings, 0 replies; 34+ messages in thread
From: Vinod Koul @ 2018-08-29 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

On 06-08-18, 16:52, Huang Shijie wrote:
> Using the dmaenginem_async_device_register to simplify code for these DMA drivers:
>     1.) dma_async_device_unregister is the last action of drv->remove().
>     2.) the dma driver does not have the ->remove().

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2018-08-29 16:14 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-06  9:43 [V2,fix] dmaengine: st_fdma: use dmaenginem_async_device_register to simplify the code Huang Shijie
2018-08-06  9:43 ` [PATCH V2 fix] " Huang Shijie
  -- strict thread matches above, loose matches on Subject: below --
2018-08-07  6:37 [v2,7/9] dmaengine: pxa_dma: " Robert Jarzmik
2018-08-07  6:37 ` [PATCH v2 7/9] " Robert Jarzmik
2018-08-07  6:32 [v2,9/9] dmaengine: add COMPILE_TEST for the drivers Robert Jarzmik
2018-08-07  6:32 ` [PATCH v2 9/9] " Robert Jarzmik
2018-08-06 10:35 [v2,9/9] " Linus Walleij
2018-08-06 10:35 ` [PATCH v2 9/9] " Linus Walleij
2018-08-06 10:34 [v2,5/9] dmaengine: ste_dma40: use dmaenginem_async_device_register to simplify the code Linus Walleij
2018-08-06 10:34 ` [PATCH v2 5/9] " Linus Walleij
2018-08-06  9:22 [v2,3/9] dmaengine: st_fdma: " Huang Shijie
2018-08-06  9:22 ` [PATCH v2 3/9] " Huang Shijie
2018-08-06  9:03 [v2,3/9] " Daniel Mack
2018-08-06  9:03 ` [PATCH v2 3/9] " Daniel Mack
2018-08-06  8:52 [v2,9/9] dmaengine: add COMPILE_TEST for the drivers Huang Shijie
2018-08-06  8:52 ` [PATCH v2 9/9] " Huang Shijie
2018-08-06  8:52 [v2,8/9] dmaengine: mxs-dma: use dmaenginem_async_device_register to simplify the code Huang Shijie
2018-08-06  8:52 ` [PATCH v2 8/9] " Huang Shijie
2018-08-06  8:52 [v2,7/9] dmaengine: pxa_dma: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 7/9] " Huang Shijie
2018-08-06  8:52 [v2,6/9] dmaengine: dma-jz4780: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 6/9] " Huang Shijie
2018-08-06  8:52 [v2,5/9] dmaengine: ste_dma40: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 5/9] " Huang Shijie
2018-08-06  8:52 [v2,4/9] dmaengine: mmp_tdma: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 4/9] " Huang Shijie
2018-08-06  8:52 [v2,3/9] dmaengine: st_fdma: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 3/9] " Huang Shijie
2018-08-06  8:52 [v2,2/9] dmaengine: stm32-mdma: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 2/9] " Huang Shijie
2018-08-06  8:52 [v2,1/9] dmaengine: dw-axi-dmac: " Huang Shijie
2018-08-06  8:52 ` [PATCH v2 1/9] " Huang Shijie
2018-08-06  8:52 [PATCH v2 0/9] dmaengine: Use " Huang Shijie
2018-08-29 16:14 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.