ASoC: Intel: sof_sdw: Avoid NULL check fail when re-probing
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Mon, 5 May 2025 14:14:09 +0000 (15:14 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 5 May 2025 22:48:39 +0000 (07:48 +0900)
commit6c965d39af98a8b79668898b3a2af40d11179ff4
tree29bfefa115394798bc2eb6775d1e36b497c2b88e
parent8ce5ace8e279d39f249fd5ead33895d04263ea36
ASoC: Intel: sof_sdw: Avoid NULL check fail when re-probing

The static platform_component name string is overwritten on card tear
down by sof_link_unload(). After this has happened the NULL check
on it in asoc_sdw_init_simple_dai_link() will fail when the driver
is reprobed, causing the machine driver to fail probe. However, it
also turns out that the ASoC core sets this string for all topology
systems in soc_check_tplg_fes() anyway, after the aforementioned
NULL check. So there is no need for the machine driver to set
the platform name to anything meaningful at all.

Replace all the platform_component stuff with some simple place
holders and importantly since the core tampers with the
snd_soc_dai_link_component in multiple places allocate a new one
for each usage.

Fixes: 59f8b622d52e ("ASoC: intel/sdw_utils: refactor init_dai_link() and init_simple_dai_link()")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250505141409.2614010-3-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/sof_sdw.c