From: Ranjani Sridharan Date: Fri, 26 May 2023 20:41:47 +0000 (-0500) Subject: ASoC: topology: Allow partial matching when finding DAI link X-Git-Tag: v6.6.7~1940^2~32^2~126^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e018e0b346706d0a0d7d7f884f3850cc0903abc2;p=platform%2Fkernel%2Flinux-starfive.git ASoC: topology: Allow partial matching when finding DAI link This allows for setting shorter link names in topology. For example, for the HDA Analog DAI link, just "Analog" would suffice instead of "Analog Playback and Capture" Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20230526204149.456068-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 20fd46a..8add361 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2030,11 +2030,11 @@ static struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, if (link->id != id) continue; - if (name && (!link->name || strcmp(name, link->name))) + if (name && (!link->name || !strstr(link->name, name))) continue; - if (stream_name && (!link->stream_name - || strcmp(stream_name, link->stream_name))) + if (stream_name && (!link->stream_name || + !strstr(link->stream_name, stream_name))) continue; return link;