summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen-Yu Tsai <wenst@chromium.org>2024-08-21 12:10:04 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-12 11:13:11 +0200
commit9795a6bd717275752c570b092cfb81440711fdd5 (patch)
treeaa1b1af2fbfacf47bbc0d3fd500687e77272b77d
parent68e6917f3d4e977834df14cfef7d2637dbeb6b1b (diff)
downloadlinux-9795a6bd717275752c570b092cfb81440711fdd5.tar.gz
linux-9795a6bd717275752c570b092cfb81440711fdd5.tar.bz2
linux-9795a6bd717275752c570b092cfb81440711fdd5.zip
ASoc: SOF: topology: Clear SOF link platform name upon unload
[ Upstream commit e0be875c5bf03a9676a6bfed9e0f1766922a7dbd ] The SOF topology loading function sets the device name for the platform component link. This should be unset when unloading the topology, otherwise a machine driver unbind/bind or reprobe would complain about an invalid component as having both its component name and of_node set: mt8186_mt6366 sound: ASoC: Both Component name/of_node are set for AFE_SOF_DL1 mt8186_mt6366 sound: error -EINVAL: Cannot register card mt8186_mt6366 sound: probe with driver mt8186_mt6366 failed with error -22 This happens with machine drivers that set the of_node separately. Clear the SOF link platform name in the topology unload callback. Fixes: 311ce4fe7637 ("ASoC: SOF: Add support for loading topologies") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://patch.msgid.link/20240821041006.2618855-1-wenst@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--sound/soc/sof/topology.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index da182314aa87..ebbd99e34143 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2050,6 +2050,8 @@ static int sof_link_unload(struct snd_soc_component *scomp, struct snd_soc_dobj
if (!slink)
return 0;
+ slink->link->platforms->name = NULL;
+
kfree(slink->tuples);
list_del(&slink->list);
kfree(slink->hw_configs);