summaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 1d83a4039738..3dc1b8af41ab 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2675,12 +2675,18 @@ int snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm,
kfree(w);
return -ENOMEM;
}
- if (dapm->codec && dapm->codec->name_prefix)
+ if (dapm->codec && dapm->codec->name_prefix) {
snprintf(w->name, name_len, "%s %s",
dapm->codec->name_prefix, widget->name);
- else
+ if (widget->sname)
+ w->sname = kasprintf(GFP_KERNEL, "%s %s",
+ dapm->codec->name_prefix,
+ widget->sname);
+ } else {
snprintf(w->name, name_len, "%s", widget->name);
-
+ if (widget->sname)
+ w->sname = kasprintf(GFP_KERNEL, "%s", widget->sname);
+ }
switch (w->id) {
case snd_soc_dapm_switch:
case snd_soc_dapm_mixer: