Commit d63c2c19 authored by Koro Chen's avatar Koro Chen Committed by Greg Kroah-Hartman

ASoC: dapm: Modify widget stream name according to prefix

commit fdb6eb0a upstream.

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: default avatarKoro Chen <koro.chen@mediatek.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 45d62f68
...@@ -3074,11 +3074,16 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, ...@@ -3074,11 +3074,16 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
} }
prefix = soc_dapm_prefix(dapm); prefix = soc_dapm_prefix(dapm);
if (prefix) if (prefix) {
w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name); 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); w->name = kasprintf(GFP_KERNEL, "%s", widget->name);
if (widget->sname)
w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname);
}
if (w->name == NULL) { if (w->name == NULL) {
kfree(w); kfree(w);
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment