diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2015-05-07 13:33:58 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-05-11 17:12:42 +0300 |
commit | 70c751095d5481d246ae7ec622ed35a76ce6ff0c (patch) | |
tree | 375bc0edde05f07ed4b1ce01568def77101b9544 /sound/soc/soc-dapm.c | |
parent | 964a0b896a7c78622801afcee77ed3d240352747 (diff) | |
download | linux-70c751095d5481d246ae7ec622ed35a76ce6ff0c.tar.xz |
ASoC: dapm: Break out of widget search when source and sink are located
Currently snd_soc_dapm_add_route will continue to search the widget list
even after both the source and sink for the route have been located.
This patch breaks out of the search when both are located giving a
small improvement in probe time for drivers.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 765416174388..63748526d630 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2617,14 +2617,20 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm, list_for_each_entry(w, &dapm->card->widgets, list) { if (!wsink && !(strcmp(w->name, sink))) { wtsink = w; - if (w->dapm == dapm) + if (w->dapm == dapm) { wsink = w; + if (wsource) + break; + } continue; } if (!wsource && !(strcmp(w->name, source))) { wtsource = w; - if (w->dapm == dapm) + if (w->dapm == dapm) { wsource = w; + if (wsink) + break; + } } } /* use widget from another DAPM context if not found from this */ |