Skip to content

Commit

Permalink
ASoC: tegra: Revert part of "ASoC: tegra: Convert to managed resources"
Browse files Browse the repository at this point in the history
Revert the problematic part of commit 470805e ("ASoC: tegra:
Convert to managed resources"). Before this commit, PM cleanup was
performed after the component was unregistered. But returning
directly will skip PM cleanup. So, to be on safe side it is better
to use snd_soc_register_component instead of
devm_snd_soc_register_component.

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 18, 2015
1 parent 470805e commit 1d15f21
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions sound/soc/tegra/tegra20_spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,8 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
goto err_pm_disable;
}

ret = devm_snd_soc_register_component(&pdev->dev,
&tegra20_spdif_component,
&tegra20_spdif_dai, 1);
ret = snd_soc_register_component(&pdev->dev, &tegra20_spdif_component,
&tegra20_spdif_dai, 1);
if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM;
Expand All @@ -341,11 +340,13 @@ static int tegra20_spdif_platform_probe(struct platform_device *pdev)
ret = tegra_pcm_platform_register(&pdev->dev);
if (ret) {
dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
return ret;
goto err_unregister_component;
}

return 0;

err_unregister_component:
snd_soc_unregister_component(&pdev->dev);
err_suspend:
if (!pm_runtime_status_suspended(&pdev->dev))
tegra20_spdif_runtime_suspend(&pdev->dev);
Expand All @@ -364,6 +365,7 @@ static int tegra20_spdif_platform_remove(struct platform_device *pdev)
tegra20_spdif_runtime_suspend(&pdev->dev);

tegra_pcm_platform_unregister(&pdev->dev);
snd_soc_unregister_component(&pdev->dev);

return 0;
}
Expand Down

0 comments on commit 1d15f21

Please sign in to comment.