Skip to contentSkip to conversation

ASoC: samsung: snow: Fix private data and node cleanup on remove

PATCH In review Yige Jiang 2 participants 2 messages Nov 24 – Nov 25

Subsystems (3)
lore
Share & tools
lore

Yige Jiang

author
#0 lore raw

PATCH 1/1 ASoC: samsung: snow: Fix private data and node cleanup on remove

The ASoC core stores the snd_soc_card pointer in the platform device's driver data. snow_remove() treats that pointer as a snow_priv instead, so the accesses to the DAI link and clock use the wrong object. Obtain the private data through snd_soc_card_get_drvdata(), as the other card callbacks do.

Also remove the explicit put of link->codecs->of_node. After the modern DAI-link conversion it is the same node that snd_soc_of_put_dai_link_codecs() releases. Keeping both puts would cause an extra reference drop once the private-data lookup is corrected. The helper alone releases the codec references for both supported bindings.

Fixes aff8d2bed9e5 ("ASoC: samsung: Add HDMI audio support for Snow")
Fixes db1623faa432 ("ASoC: samsung: snow: use modern dai_link style")

---
AI assistance was used for analysis and patch preparation.

Based on next-20261104 (8b7179210b22).
Compile-tested: arm64, GCC 14.2.0, W=1, sound/soc/samsung/snow.o; baseline and patched objects built with no warnings. Static source review; no hardware, boot, or KASAN test was performed.

 sound/soc/samsung/snow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/samsung/snow.c +2 -2
index 66ef49dff1ba37de3285cbaaf1293937d6bb0b77..64b3e2e41c2142117cb7d782b59302804d33dda7 100644
@@ -220,11 +220,11 @@ static int snow_probe(struct platform_device *pdev)
 
 static void snow_remove(struct platform_device *pdev)
 {
-	struct snow_priv *priv = platform_get_drvdata(pdev);
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+	struct snow_priv *priv = snd_soc_card_get_drvdata(card);
 	struct snd_soc_dai_link *link = &priv->dai_link;
 
 	of_node_put(link->cpus->of_node);
-	of_node_put(link->codecs->of_node);
 	snd_soc_of_put_dai_link_codecs(link);
 
 	clk_put(priv->clk_i2s_bus);

base-commit: 8b7179210b22f8e48a82c5ceacb9d56a9c4cfec4

maintainer
#1 lore raw
Quoted 1 line · Yige Jiang

ASoC: samsung: snow: Fix private data and node cleanup on remove

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5

Thanks!

[1/1] ASoC: samsung: snow: Fix private data and node cleanup on remove

      https://git.kernel.org/broonie/sound/c/2f218b200765

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark