Skip to content

Commit

Permalink
ASoC: rockchip: i2s: Adjust devm usage
Browse files Browse the repository at this point in the history
Remove use of snd_soc_unregister_component in remove function
as devm_snd_soc_register_component in probe function automatically
handles it.

Also, convert call of snd_dmaengine_pcm_register to managed resource
function devm_snd_dmaengine_pcm_register and remove usage of
snd_dmaengine_pcm_unregister in probe and remove functions.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Vaishali Thakkar authored and Mark Brown committed Aug 19, 2015
1 parent 8605965 commit ebb75c0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sound/soc/rockchip/rockchip_i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,16 +483,14 @@ static int rockchip_i2s_probe(struct platform_device *pdev)
goto err_suspend;
}

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;
return ret;
}

return 0;

err_pcm_register:
snd_dmaengine_pcm_unregister(&pdev->dev);
err_suspend:
if (!pm_runtime_status_suspended(&pdev->dev))
i2s_runtime_suspend(&pdev->dev);
Expand All @@ -512,8 +510,6 @@ static int rockchip_i2s_remove(struct platform_device *pdev)

clk_disable_unprepare(i2s->mclk);
clk_disable_unprepare(i2s->hclk);
snd_dmaengine_pcm_unregister(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);

return 0;
}
Expand Down

0 comments on commit ebb75c0

Please sign in to comment.