Use dmaenginem_async_device_register to simplify the code: remove dma_async_device_unregister. remove label err_register Signed-off-by: Huang Shijie <sjhuang@xxxxxxxxxxx> --- drivers/dma/imx-sdma.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index b4ec2d20e661..3ee28d044e3c 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -2062,7 +2062,7 @@ static int sdma_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sdma); - ret = dma_async_device_register(&sdma->dma_device); + ret = dmaenginem_async_device_register(&sdma->dma_device); if (ret) { dev_err(&pdev->dev, "unable to register\n"); goto err_init; @@ -2072,7 +2072,7 @@ static int sdma_probe(struct platform_device *pdev) ret = of_dma_controller_register(np, sdma_xlate, sdma); if (ret) { dev_err(&pdev->dev, "failed to register controller\n"); - goto err_register; + goto err_init; } spba_bus = of_find_compatible_node(NULL, NULL, "fsl,spba-bus"); @@ -2086,8 +2086,6 @@ static int sdma_probe(struct platform_device *pdev) return 0; -err_register: - dma_async_device_unregister(&sdma->dma_device); err_init: kfree(sdma->script_addrs); err_irq: @@ -2103,7 +2101,6 @@ static int sdma_remove(struct platform_device *pdev) int i; devm_free_irq(&pdev->dev, sdma->irq, sdma); - dma_async_device_unregister(&sdma->dma_device); kfree(sdma->script_addrs); clk_unprepare(sdma->clk_ahb); clk_unprepare(sdma->clk_ipg); -- 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