]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoc: SOF: topology: Clear SOF link platform name upon unload
authorChen-Yu Tsai <wenst@chromium.org>
Wed, 21 Aug 2024 04:10:04 +0000 (12:10 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 28 Aug 2024 12:01:44 +0000 (13:01 +0100)
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>
sound/soc/sof/topology.c

index b5438213199163d305aba29cc7b94e3c9ade5a43..496162df52704c814996ffb317f0e3483960e6aa 100644 (file)
@@ -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);