diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-11-05 12:39:57 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-06 05:26:57 -0500 |
commit | 246e884b82305c5669a892c04e67864f4e7c10d5 (patch) | |
tree | 69ae768fe584cf7e826bb23a571d11616a7b175b /sound | |
parent | 22a7038c3950a7a4c4d1656a04c3ca8da8296324 (diff) |
ASoC: wm8900: Use WARN_ON() instead of BUG_ON()
Use WARN_ON() and handle the error cases accordingly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/wm8900.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index 7c8257c5a17b..de67e74dca0c 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c | |||
@@ -691,7 +691,8 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, | |||
691 | unsigned int K, Ndiv, Nmod, target; | 691 | unsigned int K, Ndiv, Nmod, target; |
692 | unsigned int div; | 692 | unsigned int div; |
693 | 693 | ||
694 | BUG_ON(!Fout); | 694 | if (WARN_ON(!Fout)) |
695 | return -EINVAL; | ||
695 | 696 | ||
696 | /* The FLL must run at 90-100MHz which is then scaled down to | 697 | /* The FLL must run at 90-100MHz which is then scaled down to |
697 | * the output value by FLLCLK_DIV. */ | 698 | * the output value by FLLCLK_DIV. */ |
@@ -742,8 +743,9 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, | |||
742 | /* Move down to proper range now rounding is done */ | 743 | /* Move down to proper range now rounding is done */ |
743 | fll_div->k = K / 10; | 744 | fll_div->k = K / 10; |
744 | 745 | ||
745 | BUG_ON(target != Fout * (fll_div->fllclk_div << 2)); | 746 | if (WARN_ON(target != Fout * (fll_div->fllclk_div << 2)) || |
746 | BUG_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n); | 747 | WARN_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n)) |
748 | return -EINVAL; | ||
747 | 749 | ||
748 | return 0; | 750 | return 0; |
749 | } | 751 | } |