Use dmaenginem_async_device_register to simplify the code: remove dma_async_device_unregister. remove label err_unregister_device Signed-off-by: Huang Shijie <sjhuang@xxxxxxxxxxx> --- drivers/dma/dma-axi-dmac.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 15b2453d2647..d510184762e6 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -678,14 +678,14 @@ static int axi_dmac_probe(struct platform_device *pdev) axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, 0x00); - ret = dma_async_device_register(dma_dev); + ret = dmaenginem_async_device_register(dma_dev); if (ret) goto err_clk_disable; ret = of_dma_controller_register(pdev->dev.of_node, of_dma_xlate_by_chan_id, dma_dev); if (ret) - goto err_unregister_device; + goto err_clk_disable; ret = request_irq(dmac->irq, axi_dmac_interrupt_handler, IRQF_SHARED, dev_name(&pdev->dev), dmac); @@ -698,8 +698,6 @@ static int axi_dmac_probe(struct platform_device *pdev) err_unregister_of: of_dma_controller_free(pdev->dev.of_node); -err_unregister_device: - dma_async_device_unregister(&dmac->dma_dev); err_clk_disable: clk_disable_unprepare(dmac->clk); @@ -713,7 +711,6 @@ static int axi_dmac_remove(struct platform_device *pdev) of_dma_controller_free(pdev->dev.of_node); free_irq(dmac->irq, dmac); tasklet_kill(&dmac->chan.vchan.task); - dma_async_device_unregister(&dmac->dma_dev); clk_disable_unprepare(dmac->clk); return 0; -- 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