Skip to content

Commit

Permalink
ASoC: Simplify logic in snd_soc_dapm_set_bias_level()
Browse files Browse the repository at this point in the history
No functional changes but much less indentation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
  • Loading branch information
Mark Brown committed Jun 6, 2011
1 parent 4113e44 commit 171ec6b
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,19 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,

if (card && card->set_bias_level)
ret = card->set_bias_level(card, level);
if (ret == 0) {
if (dapm->codec && dapm->codec->driver->set_bias_level)
ret = dapm->codec->driver->set_bias_level(dapm->codec, level);
else
dapm->bias_level = level;
}
if (ret == 0) {
if (card && card->set_bias_level_post)
ret = card->set_bias_level_post(card, level);
}
if (ret != 0)
goto out;

if (dapm->codec && dapm->codec->driver->set_bias_level)
ret = dapm->codec->driver->set_bias_level(dapm->codec, level);
else
dapm->bias_level = level;
if (ret != 0)
goto out;

if (card && card->set_bias_level_post)
ret = card->set_bias_level_post(card, level);
out:
trace_snd_soc_bias_level_done(card, level);

return ret;
Expand Down

0 comments on commit 171ec6b

Please sign in to comment.