ASoC: rockchip: spdif: Convert to use devm_snd_dmaengine_pcm_register
authorAxel Lin <axel.lin@ingics.com>
Tue, 13 Oct 2015 02:37:10 +0000 (10:37 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 19 Oct 2015 19:15:16 +0000 (20:15 +0100)
Use resource managed API then we can remove snd_dmaengine_pcm_unregister()
and snd_soc_unregister_component() calls in .probe error path and .remove.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_spdif.c

index 9d5c470cee82c69865d4d83b8776a61b098f7c74..a38a3029062c8296581af1209a176b53dde29f7c 100644 (file)
@@ -355,16 +355,14 @@ static int rk_spdif_probe(struct platform_device *pdev)
                goto err_pm_runtime;
        }
 
-       ret = snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
+       ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
        if (ret) {
                dev_err(&pdev->dev, "Could not register PCM\n");
-               goto err_pcm_register;
+               goto err_pm_runtime;
        }
 
        return 0;
 
-err_pcm_register:
-       snd_dmaengine_pcm_unregister(&pdev->dev);
 err_pm_runtime:
        pm_runtime_disable(&pdev->dev);
 
@@ -381,8 +379,6 @@ static int rk_spdif_remove(struct platform_device *pdev)
 
        clk_disable_unprepare(spdif->mclk);
        clk_disable_unprepare(spdif->hclk);
-       snd_dmaengine_pcm_unregister(&pdev->dev);
-       snd_soc_unregister_component(&pdev->dev);
 
        return 0;
 }