diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-04 22:57:50 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-10-05 11:22:40 +0100 |
commit | f68d7e168785a2e89f615863fb5fab22518c8eb8 (patch) | |
tree | 6588aebb87e14a82a02d4c274070a6bec52bdf1d /sound/soc/soc-dapm.c | |
parent | f3bf3e456a8be9b359a8f4ff458ae1be4fc4c516 (diff) |
ASoC: Stop checking for supplied widgets after we find the first
We don't really care how many widgets a supply is supplying, we just care
if the number is non-zero. This didn't actually produce any improvement
in the test cases I've been using but seems obviously sensible enough that
I'm pushing it out anyway.
We could do a similar thing for other widgets but this may be unhelpful
for further refactorings Liam was working on aiming to allow us to
identify connected audio paths.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index cbca1ddb661..82d93bf3c25 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -851,7 +851,6 @@ static int dapm_dac_check_power(struct snd_soc_dapm_widget *w) static int dapm_supply_check_power(struct snd_soc_dapm_widget *w) { struct snd_soc_dapm_path *path; - int power = 0; DAPM_UPDATE_STAT(w, power_checks); @@ -869,15 +868,13 @@ static int dapm_supply_check_power(struct snd_soc_dapm_widget *w) if (!path->sink) continue; - if (dapm_widget_power_check(path->sink)) { - power = 1; - break; - } + if (dapm_widget_power_check(path->sink)) + return 1; } dapm_clear_walk(w->dapm); - return power; + return 0; } static int dapm_always_on_check_power(struct snd_soc_dapm_widget *w) |