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@xxxxxxxxxxx> --- 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 -- To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html