[alsa-devel] [PATCH 10/23] ASoC: cirrus: ep93xx-ac97.c: use devm_snd_soc_register_component()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Jun 27 04:00:42 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/cirrus/ep93xx-ac97.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index 84c967f..f074857 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -397,19 +397,17 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
 	if (ret)
 		goto fail;
 
-	ret = snd_soc_register_component(&pdev->dev, &ep93xx_ac97_component,
-					 &ep93xx_ac97_dai, 1);
+	ret = devm_snd_soc_register_component(&pdev->dev,
+				&ep93xx_ac97_component, &ep93xx_ac97_dai, 1);
 	if (ret)
 		goto fail;
 
 	ret = devm_ep93xx_pcm_platform_register(&pdev->dev);
 	if (ret)
-		goto fail_unregister;
+		goto fail;
 
 	return 0;
 
-fail_unregister:
-	snd_soc_unregister_component(&pdev->dev);
 fail:
 	ep93xx_ac97_info = NULL;
 	snd_soc_set_ac97_ops(NULL);
@@ -420,8 +418,6 @@ static int ep93xx_ac97_remove(struct platform_device *pdev)
 {
 	struct ep93xx_ac97_info	*info = platform_get_drvdata(pdev);
 
-	snd_soc_unregister_component(&pdev->dev);
-
 	/* disable the AC97 controller */
 	ep93xx_ac97_write_reg(info, AC97GCR, 0);
 
-- 
2.7.4



More information about the Alsa-devel mailing list