diff options
author | Mark Brown <broonie@linaro.org> | 2013-11-08 05:43:41 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-08 05:43:41 -0500 |
commit | 108145a60675ebc0e42e7964ee6666096bbf86ce (patch) | |
tree | 19266ab0500d7bb188eb53634d484054d59473d2 /sound/soc/codecs/wm8900.c | |
parent | 022aa51e3fda0b3c6688defaa859961c11c36ec8 (diff) | |
parent | bf4edea863c435c302041cf8bb01c8b3ca729449 (diff) |
Merge remote-tracking branch 'asoc/topic/warn' into asoc-next
Diffstat (limited to 'sound/soc/codecs/wm8900.c')
-rw-r--r-- | sound/soc/codecs/wm8900.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index 7c8257c5a17b..734209e252c3 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c | |||
@@ -279,7 +279,8 @@ static int wm8900_hp_event(struct snd_soc_dapm_widget *w, | |||
279 | break; | 279 | break; |
280 | 280 | ||
281 | default: | 281 | default: |
282 | BUG(); | 282 | WARN(1, "Invalid event %d\n", event); |
283 | break; | ||
283 | } | 284 | } |
284 | 285 | ||
285 | return 0; | 286 | return 0; |
@@ -691,7 +692,8 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, | |||
691 | unsigned int K, Ndiv, Nmod, target; | 692 | unsigned int K, Ndiv, Nmod, target; |
692 | unsigned int div; | 693 | unsigned int div; |
693 | 694 | ||
694 | BUG_ON(!Fout); | 695 | if (WARN_ON(!Fout)) |
696 | return -EINVAL; | ||
695 | 697 | ||
696 | /* The FLL must run at 90-100MHz which is then scaled down to | 698 | /* The FLL must run at 90-100MHz which is then scaled down to |
697 | * the output value by FLLCLK_DIV. */ | 699 | * the output value by FLLCLK_DIV. */ |
@@ -742,8 +744,9 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref, | |||
742 | /* Move down to proper range now rounding is done */ | 744 | /* Move down to proper range now rounding is done */ |
743 | fll_div->k = K / 10; | 745 | fll_div->k = K / 10; |
744 | 746 | ||
745 | BUG_ON(target != Fout * (fll_div->fllclk_div << 2)); | 747 | if (WARN_ON(target != Fout * (fll_div->fllclk_div << 2)) || |
746 | BUG_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n); | 748 | WARN_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n)) |
749 | return -EINVAL; | ||
747 | 750 | ||
748 | return 0; | 751 | return 0; |
749 | } | 752 | } |