[alsa-devel] [PATCH 08/16] ASoC: davinci: use devm_snd_soc_register_component()
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Fri Sep 7 03:02:08 CEST 2018
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Now we have devm_snd_soc_register_component().
Let's use it instead of snd_soc_register_component().
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
sound/soc/davinci/davinci-i2s.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index a3206e65..45404f9 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -726,7 +726,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;
@@ -734,13 +734,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);
@@ -751,8 +749,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