From 96fd04cebaa580df34ff195ca56592294df00077 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan Date: Wed, 24 May 2023 12:00:50 -0700 Subject: [PATCH] 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 --- sound/soc/soc-topology.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 47ab5cf994974a..3f9729f5847d78 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2049,11 +2049,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;