Use dmaenginem_async_device_register to simplify the code: remove dma_async_device_unregister. remove label err_of_dma_controller Signed-off-by: Huang Shijie <sjhuang@xxxxxxxxxxx> --- drivers/dma/imx-dma.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 75b6ff0415ee..d651fbea77ee 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -1186,7 +1186,7 @@ static int __init imxdma_probe(struct platform_device *pdev) imxdma->dma_device.dev->dma_parms = &imxdma->dma_parms; dma_set_max_seg_size(imxdma->dma_device.dev, 0xffffff); - ret = dma_async_device_register(&imxdma->dma_device); + ret = dmaenginem_async_device_register(&imxdma->dma_device); if (ret) { dev_err(&pdev->dev, "unable to register\n"); goto disable_dma_ahb_clk; @@ -1197,14 +1197,12 @@ static int __init imxdma_probe(struct platform_device *pdev) imxdma_xlate, imxdma); if (ret) { dev_err(&pdev->dev, "unable to register of_dma_controller\n"); - goto err_of_dma_controller; + goto disable_dma_ahb_clk; } } return 0; -err_of_dma_controller: - dma_async_device_unregister(&imxdma->dma_device); disable_dma_ahb_clk: clk_disable_unprepare(imxdma->dma_ahb); disable_dma_ipg_clk: @@ -1237,8 +1235,6 @@ static int imxdma_remove(struct platform_device *pdev) imxdma_free_irq(pdev, imxdma); - dma_async_device_unregister(&imxdma->dma_device); - if (pdev->dev.of_node) of_dma_controller_free(pdev->dev.of_node); -- 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