ASoC: wm8904: Check for clk_prepare_enable() error
authorFabio Estevam <fabio.estevam@freescale.com>
Sat, 20 Jun 2015 18:55:51 +0000 (15:55 -0300)
committerMark Brown <broonie@kernel.org>
Wed, 8 Jul 2015 18:08:57 +0000 (19:08 +0100)
clk_prepare_enable() may fail, so we should better check its return value
and propagate it in the case of error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8904.c

index 265a4a58a2d1bf7c4e80e1b48c981af4ef878ae5..07dc40022d4f40caae6df82c2b25ea6f08addfb0 100644 (file)
@@ -1837,7 +1837,9 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,
 
        switch (level) {
        case SND_SOC_BIAS_ON:
-               clk_prepare_enable(wm8904->mclk);
+               ret = clk_prepare_enable(wm8904->mclk);
+               if (ret)
+                       return ret;
                break;
 
        case SND_SOC_BIAS_PREPARE: