@@ -1332,7 +1332,7 @@ static int bam_dma_probe(struct platform_device *pdev)
bdev->common.device_tx_status = bam_tx_status;
bdev->common.dev = bdev->dev;
- ret = dma_async_device_register(&bdev->common);
+ ret = dmaenginem_async_device_register(&bdev->common);
if (ret) {
dev_err(bdev->dev, "failed to register dma async device\n");
goto err_bam_channel_exit;
@@ -1341,7 +1341,7 @@ static int bam_dma_probe(struct platform_device *pdev)
ret = of_dma_controller_register(pdev->dev.of_node, bam_dma_xlate,
&bdev->common);
if (ret)
- goto err_unregister_dma;
+ goto err_bam_channel_exit;
if (bdev->controlled_remotely) {
pm_runtime_disable(&pdev->dev);
@@ -1357,8 +1357,6 @@ static int bam_dma_probe(struct platform_device *pdev)
return 0;
-err_unregister_dma:
- dma_async_device_unregister(&bdev->common);
err_bam_channel_exit:
for (i = 0; i < bdev->num_channels; i++)
tasklet_kill(&bdev->channels[i].vc.task);
@@ -1378,7 +1376,6 @@ static int bam_dma_remove(struct platform_device *pdev)
pm_runtime_force_suspend(&pdev->dev);
of_dma_controller_free(pdev->dev.of_node);
- dma_async_device_unregister(&bdev->common);
/* mask all interrupts for this execution environment */
writel_relaxed(0, bam_addr(bdev, 0, BAM_IRQ_SRCS_MSK_EE));
Use dmaenginem_async_device_register to simplify the code: remove dma_async_device_unregister. remove label err_unregister_dma Signed-off-by: Huang Shijie <sjhuang@iluvatar.ai> --- drivers/dma/qcom/bam_dma.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)