[alsa-devel] [PATCH v2 21/23] ASoC: tegra: tegra30_i2s.c: use devm_snd_soc_register_component()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Jun 28 06:11:15 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>
---
v1 -> v2

	- no change

 sound/soc/tegra/tegra30_i2s.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c
index 2f70bf0..7d9e1e4 100644
--- a/sound/soc/tegra/tegra30_i2s.c
+++ b/sound/soc/tegra/tegra30_i2s.c
@@ -463,8 +463,8 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
 		goto err_free_rx_fifo;
 	}
 
-	ret = snd_soc_register_component(&pdev->dev, &tegra30_i2s_component,
-				   &i2s->dai, 1);
+	ret = devm_snd_soc_register_component(&pdev->dev,
+					&tegra30_i2s_component, &i2s->dai, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "Could not register DAI: %d\n", ret);
 		ret = -ENOMEM;
@@ -476,13 +476,11 @@ static int tegra30_i2s_platform_probe(struct platform_device *pdev)
 				i2s->capture_dma_chan);
 	if (ret) {
 		dev_err(&pdev->dev, "Could not register PCM: %d\n", ret);
-		goto err_unregister_component;
+		goto err_unroute_rx_fifo;
 	}
 
 	return 0;
 
-err_unregister_component:
-	snd_soc_unregister_component(&pdev->dev);
 err_unroute_rx_fifo:
 	tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif);
 err_free_rx_fifo:
@@ -510,8 +508,6 @@ static int tegra30_i2s_platform_remove(struct platform_device *pdev)
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		tegra30_i2s_runtime_suspend(&pdev->dev);
 
-	snd_soc_unregister_component(&pdev->dev);
-
 	tegra30_ahub_unset_rx_cif_source(i2s->capture_fifo_cif);
 	tegra30_ahub_free_rx_fifo(i2s->capture_fifo_cif);
 
-- 
2.7.4



More information about the Alsa-devel mailing list