summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8900.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-11-08 10:43:41 +0000
committerMark Brown <broonie@linaro.org>2013-11-08 10:43:41 +0000
commit108145a60675ebc0e42e7964ee6666096bbf86ce (patch)
tree19266ab0500d7bb188eb53634d484054d59473d2 /sound/soc/codecs/wm8900.c
parent022aa51e3fda0b3c6688defaa859961c11c36ec8 (diff)
parentbf4edea863c435c302041cf8bb01c8b3ca729449 (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.c11
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,
break;
default:
- BUG();
+ WARN(1, "Invalid event %d\n", event);
+ break;
}
return 0;
@@ -691,7 +692,8 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
unsigned int K, Ndiv, Nmod, target;
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 output value by FLLCLK_DIV. */
@@ -742,8 +744,9 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
/* Move down to proper range now rounding is done */
fll_div->k = K / 10;
- BUG_ON(target != Fout * (fll_div->fllclk_div << 2));
- BUG_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n);
+ if (WARN_ON(target != Fout * (fll_div->fllclk_div << 2)) ||
+ WARN_ON(!K && target != Fref * fll_div->fll_ratio * fll_div->n))
+ return -EINVAL;
return 0;
}