* [PATCH] ASoC: dapm: Don't create routes when creating kcontrols
@ 2013-08-12 22:38 Mark Brown
2013-08-13 8:54 ` Lars-Peter Clausen
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2013-08-12 22:38 UTC (permalink / raw)
To: Liam Girdwood, Lars-Peter Clausen; +Cc: alsa-devel, linaro-kernel, Mark Brown
From: Mark Brown <broonie@linaro.org>
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>
---
sound/soc/soc-dapm.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 662a904..b78eaa1 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);
}
}
@@ -821,7 +822,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
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;
--
1.8.4.rc1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: dapm: Don't create routes when creating kcontrols
2013-08-12 22:38 [PATCH] ASoC: dapm: Don't create routes when creating kcontrols Mark Brown
@ 2013-08-13 8:54 ` Lars-Peter Clausen
0 siblings, 0 replies; 2+ messages in thread
From: Lars-Peter Clausen @ 2013-08-13 8:54 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, linaro-kernel, Liam Girdwood, Mark Brown
On 08/13/2013 12:38 AM, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
>
> 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>
Thanks.
[...]
> @@ -821,7 +822,7 @@ static int dapm_new_mux(struct snd_soc_dapm_widget *w)
> path = list_first_entry(&w->sources, struct snd_soc_dapm_path,
> list_sink);
The two lines above can also be removed
>
> - ret = dapm_create_or_share_mixmux_kcontrol(w, 0, path);
> + ret = dapm_create_or_share_mixmux_kcontrol(w, 0);
> if (ret < 0)
> return ret;
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-13 9:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-12 22:38 [PATCH] ASoC: dapm: Don't create routes when creating kcontrols Mark Brown
2013-08-13 8:54 ` Lars-Peter Clausen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.