]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: Only provide a default bias level update for CODEC contexts
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 6 Jun 2011 18:03:34 +0000 (19:03 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 6 Jun 2011 20:47:05 +0000 (21:47 +0100)
This allows the card driver to use the bias level variable more easily in
multi component systems.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
sound/soc/soc-dapm.c

index 1682834f8c380217453f4da62b6b0a98b00d4c3a..34106bca63cfb854161ded34f139ddbca43ec6d1 100644 (file)
@@ -146,10 +146,13 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_dapm_context *dapm,
        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 (dapm->codec) {
+               if (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;