Skip to content

Commit

Permalink
ASoC: sun4i-i2s: Switch to devm for PCM register
Browse files Browse the repository at this point in the history
Since the introduction of the driver, a new managed helper for the
dmaengine PCM registration has been created. Let's use it to simplify a bit
our probe and remove functions.

Signed-off-by: Maxime Ripard <[email protected]>
Link: https://lore.kernel.org/r/606d271187091e858e8c15e20555af0b79798fe1.1566242458.git-series.maxime.ripard@bootlin.com
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
mripard authored and broonie committed Aug 20, 2019
1 parent 6e3360c commit a49d24e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sound/soc/sunxi/sun4i-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ static int sun4i_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_suspend;
Expand Down Expand Up @@ -1183,8 +1183,6 @@ static int sun4i_i2s_remove(struct platform_device *pdev)
{
struct sun4i_i2s *i2s = dev_get_drvdata(&pdev->dev);

snd_dmaengine_pcm_unregister(&pdev->dev);

pm_runtime_disable(&pdev->dev);
if (!pm_runtime_status_suspended(&pdev->dev))
sun4i_i2s_runtime_suspend(&pdev->dev);
Expand Down

0 comments on commit a49d24e

Please sign in to comment.