summaryrefslogtreecommitdiff
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-10-25 19:41:57 +0400
committerMark Brown <broonie@kernel.org>2014-10-28 03:19:59 +0300
commit98407efc1384b31cdcb1eeddc74ee35499d3418f (patch)
treefad0b13207aa72662e5b45420c8c3a83e0fd24e9 /sound/soc/soc-dapm.c
parent4a2019480bc5146eb54fc5f0b2ff57b95629a09a (diff)
downloadlinux-98407efc1384b31cdcb1eeddc74ee35499d3418f.tar.xz
ASoC: dapm: Do not add un-muxed paths to MUX control
Paths that are directly connected to a MUX widget are not affected by changes to the MUX's control. Rather than checking if a path is directly connected each time the MUX is updated do it only once when MUX is created. We can also remove the check for e->texts[mux] != NULL, since if that condition was true the code would have had already crashed much earlier (And generally speaking if a enum's 'texts' entry is NULL it's a bug in the driver). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 116d4436c575..1fed2207b024 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -738,8 +738,10 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
if (ret < 0)
return ret;
- list_for_each_entry(path, &w->sources, list_sink)
- dapm_kcontrol_add_path(w->kcontrols[0], path);
+ list_for_each_entry(path, &w->sources, list_sink) {
+ if (path->name)
+ dapm_kcontrol_add_path(w->kcontrols[0], path);
+ }
return 0;
}
@@ -1955,9 +1957,6 @@ static int soc_dapm_mux_update_power(struct snd_soc_card *card,
/* find dapm widget path assoc with kcontrol */
dapm_kcontrol_for_each_path(path, kcontrol) {
- if (!path->name || !e->texts[mux])
- continue;
-
found = 1;
/* we now need to match the string in the enum to the path */
if (!(strcmp(path->name, e->texts[mux])))