Skip to content

Commit

Permalink
ASoC: Stop checking for supplied widgets after we find the first
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Oct 5, 2011
1 parent f3bf3e4 commit f68d7e1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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)
Expand Down

0 comments on commit f68d7e1

Please sign in to comment.