lkml.org 
[lkml]   [2018]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 15/46] dmaengine: s3c24xx-dma: use dmaenginem_async_device_register to simplify the code
Date
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);
--
2.17.1
\
 
 \ /
  Last update: 2018-08-03 09:25    [W:0.172 / U:5.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site