aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorKoro Chen <koro.chen@mediatek.com>2015-05-10 22:36:53 -0400
committerMark Brown <broonie@kernel.org>2015-05-12 14:01:56 -0400
commitfdb6eb0a12871d5bfaf266c5a0d5259a5437a72f (patch)
treeb9705ad8193f8059284e88f2b74403c0b47a3fac /sound/soc
parentb787f68c36d49bb1d9236f403813641efa74a031 (diff)
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 <koro.chen@mediatek.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'sound/soc')
-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 defe0f0082b5..158204d08924 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3100,11 +3100,16 @@ snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
3100 } 3100 }
3101 3101
3102 prefix = soc_dapm_prefix(dapm); 3102 prefix = soc_dapm_prefix(dapm);
3103 if (prefix) 3103 if (prefix) {
3104 w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name); 3104 w->name = kasprintf(GFP_KERNEL, "%s %s", prefix, widget->name);
3105 else 3105 if (widget->sname)
3106 w->sname = kasprintf(GFP_KERNEL, "%s %s", prefix,
3107 widget->sname);
3108 } else {
3106 w->name = kasprintf(GFP_KERNEL, "%s", widget->name); 3109 w->name = kasprintf(GFP_KERNEL, "%s", widget->name);
3107 3110 if (widget->sname)
3111 w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname);
3112 }
3108 if (w->name == NULL) { 3113 if (w->name == NULL) {
3109 kfree(w); 3114 kfree(w);
3110 return NULL; 3115 return NULL;