aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoro Chen <koro.chen@mediatek.com>2015-05-11 10:36:53 +0800
committerSasha Levin <sasha.levin@oracle.com>2015-06-10 13:42:11 -0400
commitf223455e2074c3bf929fc5e427ad68f06a252554 (patch)
treeb33f35f0744e5dd6bf19a63262c0bc81126fbc14
parentc9717bdb1c17a76def4d98da16a5053fd916bee4 (diff)
ASoC: dapm: Modify widget stream name according to prefix
[ Upstream commit fdb6eb0a12871d5bfaf266c5a0d5259a5437a72f ] 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 <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r--sound/soc/soc-dapm.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index c61cb9cedbcd..943e6a9a6319 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3076,11 +3076,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;