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@xxxxxxxxxxx> --- 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); -- 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