Skip to content

Commit

Permalink
ASoc: SOF: topology: Clear SOF link platform name upon unload
Browse files Browse the repository at this point in the history
[ Upstream commit e0be875 ]

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: 311ce4f ("ASoC: SOF: Add support for loading topologies")
Signed-off-by: Chen-Yu Tsai <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
wens authored and gregkh committed Sep 12, 2024
1 parent 05500a4 commit f39bde3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -2040,6 +2040,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);
Expand Down

0 comments on commit f39bde3

Please sign in to comment.