summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown2013-08-13 00:28:42 +0200
committerMark Brown2013-08-13 11:19:57 +0200
commit946d92a100f6c36b1c53922d5105b3c19a59173d (patch)
tree87dbb9ac2103b823c1f2ef85a8612bc687e8d817 /sound/soc/soc-dapm.c
parentMerge remote-tracking branch 'asoc/fix/dapm' into asoc-dapm (diff)
downloadkernel-qcow2-linux-946d92a100f6c36b1c53922d5105b3c19a59173d.tar.gz
kernel-qcow2-linux-946d92a100f6c36b1c53922d5105b3c19a59173d.tar.xz
kernel-qcow2-linux-946d92a100f6c36b1c53922d5105b3c19a59173d.zip
ASoC: dapm: Don't create routes when creating kcontrols
Attempting to create the route as part of adding a mux control causes us to attempt to add the same route twice since we loop over all sources for the mux after creating the control. Instead do the addition in the callers. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 662a904c2b79..b885a9bedc4e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -665,7 +665,7 @@ static int dapm_is_shared_kcontrol(struct snd_soc_dapm_context *dapm,
* create it. Either way, add the widget into the control's widget list
*/
static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
- int kci, struct snd_soc_dapm_path *path)
+ int kci)
{
struct snd_soc_dapm_context *dapm = w->dapm;
struct snd_card *card = dapm->card->snd_card;
@@ -766,7 +766,6 @@ static int dapm_create_or_share_mixmux_kcontrol(struct snd_soc_dapm_widget *w,
return ret;
w->kcontrols[kci] = kcontrol;
- dapm_kcontrol_add_path(kcontrol, path);
return 0;
}
@@ -790,9 +789,11 @@ static int dapm_new_mixer(struct snd_soc_dapm_widget *w)
continue;
}
- ret = dapm_create_or_share_mixmux_kcontrol(w, i, path);
+ ret = dapm_create_or_share_mixmux_kcontrol(w, i);
if (ret < 0)
return ret;
+
+ dapm_kcontrol_add_path(w->kcontrols[i], path);
}
}
@@ -818,10 +819,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
return -EINVAL;
}
- path = list_first_entry(&w->sources, struct snd_soc_dapm_path,
- list_sink);
-
- ret = dapm_create_or_share_mixmux_kcontrol(w, 0, path);
+ ret = dapm_create_or_share_mixmux_kcontrol(w, 0);
if (ret < 0)
return ret;