From: Mark Brown Date: Mon, 28 Nov 2011 21:16:56 +0000 (+0000) Subject: ASoC: Error out if we can't generate a LRCLK at all for WM8994 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc07ecd851bd082265b52838eff12f50b88f6114;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ASoC: Error out if we can't generate a LRCLK at all for WM8994 Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 9c982e47eb9..36ba1edfff8 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -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);