diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-05-07 10:20:25 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-05-12 16:34:43 -0400 |
commit | a4e9154c429abde956fad10f7c7e7e50d6a1da9f (patch) | |
tree | 478d4b24aff3a111c92f3f4bc080c2c11f2aba72 | |
parent | c9e065c27fe9b81e5d6e7681d77a24f7b9616675 (diff) |
ASoC: dapm: Revert "ASoC: dapm: Fix double prefix addition"
This reverts commit bd23c5b661858446267f4d6b2fb4edd8eb710dda.
The patch claims that the patch is necessary to avoid double prefix addition
when calling snd_soc_dapm_add_route() from snd_soc_dapm_connect_dai_link_widgets().
But snd_soc_dapm_add_route() is called with the card's DAPM context, which does
not have a prefix, which means there is no prefix that could be added a second
time.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/soc-dapm.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index fb6c7b793459..10ed22f457b8 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -2381,8 +2381,7 @@ err: | |||
2381 | } | 2381 | } |
2382 | 2382 | ||
2383 | static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, | 2383 | static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, |
2384 | const struct snd_soc_dapm_route *route, | 2384 | const struct snd_soc_dapm_route *route) |
2385 | unsigned int is_prefixed) | ||
2386 | { | 2385 | { |
2387 | struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w; | 2386 | struct snd_soc_dapm_widget *wsource = NULL, *wsink = NULL, *w; |
2388 | struct snd_soc_dapm_widget *wtsource = NULL, *wtsink = NULL; | 2387 | struct snd_soc_dapm_widget *wtsource = NULL, *wtsink = NULL; |
@@ -2392,7 +2391,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, | |||
2392 | char prefixed_source[80]; | 2391 | char prefixed_source[80]; |
2393 | int ret; | 2392 | int ret; |
2394 | 2393 | ||
2395 | if (dapm->codec && dapm->codec->name_prefix && !is_prefixed) { | 2394 | if (dapm->codec && dapm->codec->name_prefix) { |
2396 | snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s", | 2395 | snprintf(prefixed_sink, sizeof(prefixed_sink), "%s %s", |
2397 | dapm->codec->name_prefix, route->sink); | 2396 | dapm->codec->name_prefix, route->sink); |
2398 | sink = prefixed_sink; | 2397 | sink = prefixed_sink; |
@@ -2520,7 +2519,7 @@ int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, | |||
2520 | 2519 | ||
2521 | mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); | 2520 | mutex_lock_nested(&dapm->card->dapm_mutex, SND_SOC_DAPM_CLASS_INIT); |
2522 | for (i = 0; i < num; i++) { | 2521 | for (i = 0; i < num; i++) { |
2523 | r = snd_soc_dapm_add_route(dapm, route, false); | 2522 | r = snd_soc_dapm_add_route(dapm, route); |
2524 | if (r < 0) { | 2523 | if (r < 0) { |
2525 | dev_err(dapm->dev, "ASoC: Failed to add route %s -> %s -> %s\n", | 2524 | dev_err(dapm->dev, "ASoC: Failed to add route %s -> %s -> %s\n", |
2526 | route->source, | 2525 | route->source, |
@@ -3427,7 +3426,7 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) | |||
3427 | cpu_dai->codec->name, r.source, | 3426 | cpu_dai->codec->name, r.source, |
3428 | codec_dai->platform->name, r.sink); | 3427 | codec_dai->platform->name, r.sink); |
3429 | 3428 | ||
3430 | snd_soc_dapm_add_route(&card->dapm, &r, true); | 3429 | snd_soc_dapm_add_route(&card->dapm, &r); |
3431 | } | 3430 | } |
3432 | 3431 | ||
3433 | /* connect BE DAI capture if widgets are valid */ | 3432 | /* connect BE DAI capture if widgets are valid */ |
@@ -3438,7 +3437,7 @@ void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card) | |||
3438 | codec_dai->codec->name, r.source, | 3437 | codec_dai->codec->name, r.source, |
3439 | cpu_dai->platform->name, r.sink); | 3438 | cpu_dai->platform->name, r.sink); |
3440 | 3439 | ||
3441 | snd_soc_dapm_add_route(&card->dapm, &r, true); | 3440 | snd_soc_dapm_add_route(&card->dapm, &r); |
3442 | } | 3441 | } |
3443 | 3442 | ||
3444 | } | 3443 | } |