[10/23] ASoC: cirrus: ep93xx-ac97.c: use devm_snd_soc_register_component()
diff mbox series

Message ID 87o92jiybp.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series
  • ASoC: use devm_xxx
Related show

Commit Message

Kuninori Morimoto June 27, 2019, 2 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

We have devm_xxx version of snd_soc_register_component,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/cirrus/ep93xx-ac97.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Patch
diff mbox series

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);