ASoC: Error out if we can't generate a LRCLK at all for WM8994
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 28 Nov 2011 21:16:56 +0000 (21:16 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 28 Nov 2011 22:10:05 +0000 (22:10 +0000)
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/codecs/wm8994.c

index 9c982e47eb99308b377e7143d8024c19863b14c5..36ba1edfff808ac8cc3a864acc959e3f03950590 100644 (file)
@@ -2357,6 +2357,11 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream,
        bclk |= best << WM8994_AIF1_BCLK_DIV_SHIFT;
 
        lrclk = bclk_rate / params_rate(params);
+       if (!lrclk) {
+               dev_err(dai->dev, "Unable to generate LRCLK from %dHz BCLK\n",
+                       bclk_rate);
+               return -EINVAL;
+       }
        dev_dbg(dai->dev, "Using LRCLK rate %d for actual LRCLK %dHz\n",
                lrclk, bclk_rate / lrclk);