[alsa-devel] [PATCH 23/23] ASoC: ux500: ux500_msp_dai.c: use devm_snd_soc_register_component()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Jun 27 04:01:44 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/ux500/ux500_msp_dai.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c
index dec065f..17832ca 100644
--- a/sound/soc/ux500/ux500_msp_dai.c
+++ b/sound/soc/ux500/ux500_msp_dai.c
@@ -800,7 +800,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
 	}
 	dev_set_drvdata(&pdev->dev, drvdata);
 
-	ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component,
+	ret = devm_snd_soc_register_component(&pdev->dev, &ux500_msp_component,
 					 &ux500_msp_dai_drv, 1);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n",
@@ -813,14 +813,10 @@ static int ux500_msp_drv_probe(struct platform_device *pdev)
 		dev_err(&pdev->dev,
 			"Error: %s: Failed to register PCM platform device!\n",
 			__func__);
-		goto err_reg_plat;
+		return ret;
 	}
 
 	return 0;
-
-err_reg_plat:
-	snd_soc_unregister_component(&pdev->dev);
-	return ret;
 }
 
 static int ux500_msp_drv_remove(struct platform_device *pdev)
@@ -829,8 +825,6 @@ static int ux500_msp_drv_remove(struct platform_device *pdev)
 
 	ux500_pcm_unregister_platform(pdev);
 
-	snd_soc_unregister_component(&pdev->dev);
-
 	prcmu_qos_remove_requirement(PRCMU_QOS_APE_OPP, "ux500_msp_i2s");
 
 	ux500_msp_i2s_cleanup_msp(pdev, drvdata->msp);
-- 
2.7.4



More information about the Alsa-devel mailing list