[14/23] ASoC: fsl: imx-ssi.c: use devm_snd_soc_register_component()
diff mbox series

Message ID 87imsriyb8.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/fsl/imx-ssi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Patch
diff mbox series

diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c
index 9038b61..24b2908 100644
--- a/sound/soc/fsl/imx-ssi.c
+++ b/sound/soc/fsl/imx-ssi.c
@@ -586,7 +586,7 @@  static int imx_ssi_probe(struct platform_device *pdev)
 		goto failed_register;
 	}
 
-	ret = snd_soc_register_component(&pdev->dev, &imx_component,
+	ret = devm_snd_soc_register_component(&pdev->dev, &imx_component,
 					 dai, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "register DAI failed\n");
@@ -603,13 +603,11 @@  static int imx_ssi_probe(struct platform_device *pdev)
 
 	if (ssi->fiq_init && ssi->dma_init) {
 		ret = ssi->fiq_init;
-		goto failed_pcm;
+		goto failed_register;
 	}
 
 	return 0;
 
-failed_pcm:
-	snd_soc_unregister_component(&pdev->dev);
 failed_register:
 	clk_disable_unprepare(ssi->clk);
 failed_clk:
@@ -625,8 +623,6 @@  static int imx_ssi_remove(struct platform_device *pdev)
 	if (!ssi->fiq_init)
 		imx_pcm_fiq_exit(pdev);
 
-	snd_soc_unregister_component(&pdev->dev);
-
 	if (ssi->flags & IMX_SSI_USE_AC97)
 		ac97_ssi = NULL;