[alsa-devel] [PATCH 18/23] ASoC: tegra: tegra20_i2s.c: use devm_snd_soc_register_component()
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Thu Jun 27 04:01:16 CEST 2019
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
We have devm_xxx version of snd_soc_register_component,
let's use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
sound/soc/tegra/tegra20_i2s.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c
index 005fc4e6..0dba694 100644
--- a/sound/soc/tegra/tegra20_i2s.c
+++ b/sound/soc/tegra/tegra20_i2s.c
@@ -376,8 +376,8 @@ static int tegra20_i2s_platform_probe(struct platform_device *pdev)
goto err_pm_disable;
}
- ret = snd_soc_register_component(&pdev->dev, &tegra20_i2s_component,
- &i2s->dai, 1);
+ ret = devm_snd_soc_register_component(&pdev->dev,
+ &tegra20_i2s_component, &i2s->dai, 1);
if (ret) {
dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
ret = -ENOMEM;
@@ -387,13 +387,11 @@ static int tegra20_i2s_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);
- goto err_unregister_component;
+ goto err_suspend;
}
return 0;
-err_unregister_component:
- snd_soc_unregister_component(&pdev->dev);
err_suspend:
if (!pm_runtime_status_suspended(&pdev->dev))
tegra20_i2s_runtime_suspend(&pdev->dev);
@@ -414,7 +412,6 @@ static int tegra20_i2s_platform_remove(struct platform_device *pdev)
tegra20_i2s_runtime_suspend(&pdev->dev);
tegra_pcm_platform_unregister(&pdev->dev);
- snd_soc_unregister_component(&pdev->dev);
clk_put(i2s->clk_i2s);
--
2.7.4
More information about the Alsa-devel
mailing list