Thread (1 message) 1 message, 1 author, 2018-08-03
STALE2916d

[10/46] dmaengine: tegra210-adma: use helper dmaenginem_async_device_register

From: Huang Shijie <hidden>
Date: 2018-08-03 07:21:32
Also in: lkml
Subsystem: dma generic offload engine subsystem, tegra dma drivers, the rest · Maintainers: Vinod Koul, Laxman Dewangan, Jon Hunter, Linus Torvalds

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

Signed-off-by: Huang Shijie <redacted>
---
 drivers/dma/tegra210-adma.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/tegra210-adma.c b/drivers/dma/tegra210-adma.c
index b26256f23d67..bd99f12a00e3 100644
--- a/drivers/dma/tegra210-adma.c
+++ b/drivers/dma/tegra210-adma.c
@@ -746,7 +746,7 @@ static int tegra_adma_probe(struct platform_device *pdev)
 	tdma->dma_dev.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
 	tdma->dma_dev.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT;
 
-	ret = dma_async_device_register(&tdma->dma_dev);
+	ret = dmaenginem_async_device_register(&tdma->dma_dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "ADMA registration failed: %d\n", ret);
 		goto irq_dispose;
@@ -756,7 +756,7 @@ static int tegra_adma_probe(struct platform_device *pdev)
 					 tegra_dma_of_xlate, tdma);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "ADMA OF registration failed %d\n", ret);
-		goto dma_remove;
+		goto irq_dispose;
 	}
 
 	pm_runtime_put(&pdev->dev);
@@ -766,8 +766,6 @@ static int tegra_adma_probe(struct platform_device *pdev)
 
 	return 0;
 
-dma_remove:
-	dma_async_device_unregister(&tdma->dma_dev);
 irq_dispose:
 	while (--i >= 0)
 		irq_dispose_mapping(tdma->channels[i].irq);
@@ -786,8 +784,6 @@ static int tegra_adma_remove(struct platform_device *pdev)
 	struct tegra_adma *tdma = platform_get_drvdata(pdev);
 	int i;
 
-	dma_async_device_unregister(&tdma->dma_dev);
-
 	for (i = 0; i < tdma->nr_channels; ++i)
 		irq_dispose_mapping(tdma->channels[i].irq);
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help