[alsa-devel] [PATCH 16/16] ASoC: ux500: use devm_snd_soc_register_component()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Fri Sep 7 03:04:07 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/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 625b72a..3104b18 100644
--- a/sound/soc/ux500/ux500_msp_dai.c
+++ b/sound/soc/ux500/ux500_msp_dai.c
@@ -803,7 +803,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",
@@ -816,14 +816,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)
@@ -832,8 +828,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