Skip to contentSkip to conversation

Asoc: au1x: Use devm_snd_soc_register_component()

PATCH In review Zhen Ni 2 participants 2 messages Mar 1, 2022

Subsystems (2)
lore
Share & tools
lore

Zhen Ni

author
#0 lore raw

PATCH 1/1 Asoc: au1x: Use devm_snd_soc_register_component()

Using devm_snd_soc_register_component()
instead of snd_soc_register_component()

---
 sound/soc/au1x/ac97c.c    | 2 +-
 sound/soc/au1x/i2sc.c     | 2 +-
 sound/soc/au1x/psc-ac97.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/au1x/ac97c.c +1 -1
index 3b1700e665f5..795bba756585 100644
@@ -275,7 +275,7 @@ static int au1xac97c_drvprobe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = snd_soc_register_component(&pdev->dev, &au1xac97c_component,
+	ret = devm_snd_soc_register_component(&pdev->dev, &au1xac97c_component,
 					 &au1xac97c_dai_driver, 1);
 	if (ret)
 		return ret;
sound/soc/au1x/i2sc.c +1 -1
index 740d4e052e4d..a3c9d52ef337 100644
@@ -265,7 +265,7 @@ static int au1xi2s_drvprobe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, ctx);
 
-	return snd_soc_register_component(&pdev->dev, &au1xi2s_component,
+	return devm_snd_soc_register_component(&pdev->dev, &au1xi2s_component,
 					  &au1xi2s_dai_driver, 1);
 }
 
sound/soc/au1x/psc-ac97.c +1 -1
index 05eb36991f14..3f60313822e7 100644
@@ -411,7 +411,7 @@ static int au1xpsc_ac97_drvprobe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = snd_soc_register_component(&pdev->dev, &au1xpsc_ac97_component,
+	ret = devm_snd_soc_register_component(&pdev->dev, &au1xpsc_ac97_component,
 					 &wd->dai_drv, 1);
 	if (ret)
 		return ret;
Signature · 1 line
2.20.1
maintainer
#1 lore raw

sound/soc/au1x/psc-ac97.c static int au1xpsc_ac97_drvprobe(struct platform_device *pdev) · line 417

Quoted 11 lines · Zhen Ni

+++ b/sound/soc/au1x/psc-ac97.c

sound/soc/au1x/psc-ac97.c +1 -1
@@ -411,7 +411,7 @@ static int au1xpsc_ac97_drvprobe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	ret = snd_soc_register_component(&pdev->dev, &au1xpsc_ac97_component,
+	ret = devm_snd_soc_register_component(&pdev->dev, &au1xpsc_ac97_component,
 					 &wd->dai_drv, 1);
 	if (ret)
 		return ret;

This introduces a double free since there is a remove() function which calls snd_soc_unregister_component().