Commit 246e884b authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: wm8900: Use WARN_ON() instead of BUG_ON()

Use WARN_ON() and handle the error cases accordingly.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 22a7038c
...@@ -691,7 +691,8 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, ...@@ -691,7 +691,8 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
unsigned int K, Ndiv, Nmod, target; unsigned int K, Ndiv, Nmod, target;
unsigned int div; unsigned int div;
BUG_ON(!Fout); if (WARN_ON(!Fout))
return -EINVAL;
/* The FLL must run at 90-100MHz which is then scaled down to /* The FLL must run at 90-100MHz which is then scaled down to
* the output value by FLLCLK_DIV. */ * the output value by FLLCLK_DIV. */
...@@ -742,8 +743,9 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, ...@@ -742,8 +743,9 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
/* Move down to proper range now rounding is done */ /* Move down to proper range now rounding is done */
fll_div->k = K / 10; fll_div->k = K / 10;
BUG_ON(target != Fout * (fll_div->fllclk_div << 2)); if (WARN_ON(target != Fout * (fll_div->fllclk_div << 2)) ||
BUG_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n); WARN_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n))
return -EINVAL;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment