Use dmaenginem_async_device_register to simplify the code: remove dma_async_device_unregister remove the label err_unregister_dma_dev Signed-off-by: Huang Shijie <sjhuang@xxxxxxxxxxx> --- drivers/dma/tegra20-apb-dma.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index 9a558e30c461..9f6f51abbeef 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -1444,7 +1444,7 @@ static int tegra_dma_probe(struct platform_device *pdev) tdma->dma_dev.device_tx_status = tegra_dma_tx_status; tdma->dma_dev.device_issue_pending = tegra_dma_issue_pending; - ret = dma_async_device_register(&tdma->dma_dev); + ret = dmaenginem_async_device_register(&tdma->dma_dev); if (ret < 0) { dev_err(&pdev->dev, "Tegra20 APB DMA driver registration failed %d\n", ret); @@ -1456,15 +1456,13 @@ static int tegra_dma_probe(struct platform_device *pdev) if (ret < 0) { dev_err(&pdev->dev, "Tegra20 APB DMA OF registration failed %d\n", ret); - goto err_unregister_dma_dev; + goto err_irq; } dev_info(&pdev->dev, "Tegra20 APB DMA driver register %d channels\n", cdata->nr_channels); return 0; -err_unregister_dma_dev: - dma_async_device_unregister(&tdma->dma_dev); err_irq: while (--i >= 0) { struct tegra_dma_channel *tdc = &tdma->channels[i]; @@ -1485,8 +1483,6 @@ static int tegra_dma_remove(struct platform_device *pdev) int i; struct tegra_dma_channel *tdc; - dma_async_device_unregister(&tdma->dma_dev); - for (i = 0; i < tdma->chip_data->nr_channels; ++i) { tdc = &tdma->channels[i]; free_irq(tdc->irq, tdc); -- 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