ASoC: dapm: Modify widget stream name according to prefix
Subsystems (3)
PATCH 1/1 ASoC: dapm: Modify widget stream name according to prefix
When there is prefix specified, currently we will add this prefix in widget->name, but not in widget->sname.
it causes failure at snd_soc_dapm_link_dai_widgets:
if (!w->sname || !strstr(w->sname, dai_w->name))
because dai_w->name has prefix added, but w->sname does not. We should also add prefix for stream name
Signed-off-by Koro Chen <[email protected]>
--- sound/soc/soc-dapm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
sound/soc/soc-dapm.c +8 -3
@@ -3100,11 +3100,16 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, } prefix =soc_dapm_prefix (dapm); -if (prefix) +if (prefix) { w->name =kasprintf (GFP_KERNEL ,"%s %s" , prefix, widget->name); -else +if (widget->sname) + w->sname =kasprintf (GFP_KERNEL ,"%s %s" , prefix, + widget->sname); + }else { w->name =kasprintf (GFP_KERNEL ,"%s" , widget->name); - +if (widget->sname) + w->sname =kasprintf (GFP_KERNEL ,"%s" , widget->sname); + }if (w->name ==NULL ) {kfree (w);return NULL ;
Signature · 1 line
1.8.1.1.dirty
Quoted 3 lines · Koro Chen
When there is prefix specified, currently we will add this prefix in
widget->name, but not inwidget->sname.
it causes failure atsnd_soc_dapm_link_dai_widgets:
Applied, thanks.