[alsa-devel] [PATCH v2 22/23] ASoC: ti: davinci-i2s.c: use devm_snd_soc_register_component()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Jun 28 06:11:24 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/ti/davinci-i2s.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c
index 92c1bdc..67b8538 100644
--- a/sound/soc/ti/davinci-i2s.c
+++ b/sound/soc/ti/davinci-i2s.c
@@ -723,7 +723,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 	dev->dev = &pdev->dev;
 	dev_set_drvdata(&pdev->dev, dev);
 
-	ret = snd_soc_register_component(&pdev->dev, &davinci_i2s_component,
+	ret = devm_snd_soc_register_component(&pdev->dev, &davinci_i2s_component,
 					 &davinci_i2s_dai, 1);
 	if (ret != 0)
 		goto err_release_clk;
@@ -731,13 +731,11 @@ static int davinci_i2s_probe(struct platform_device *pdev)
 	ret = edma_pcm_platform_register(&pdev->dev);
 	if (ret) {
 		dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
-		goto err_unregister_component;
+		goto err_release_clk;
 	}
 
 	return 0;
 
-err_unregister_component:
-	snd_soc_unregister_component(&pdev->dev);
 err_release_clk:
 	clk_disable(dev->clk);
 	clk_put(dev->clk);
@@ -748,8 +746,6 @@ static int davinci_i2s_remove(struct platform_device *pdev)
 {
 	struct davinci_mcbsp_dev *dev = dev_get_drvdata(&pdev->dev);
 
-	snd_soc_unregister_component(&pdev->dev);
-
 	clk_disable(dev->clk);
 	clk_put(dev->clk);
 	dev->clk = NULL;
-- 
2.7.4



More information about the Alsa-devel mailing list