aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-05 12:39:49 -0500
committerMark Brown <broonie@linaro.org>2013-11-06 05:26:14 -0500
commitbee026d0fe4bcc2b29e9279c319ed5e60a3bda97 (patch)
tree53bbda0604a6d6802a00def993233c984b509b3b /sound
parentddb146da23cb08851fa418481dd84412f99eec1e (diff)
ASoC: max98088: 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/max98088.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c
index 566a367c94fa..8bd2d8a6a2f5 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -621,8 +621,9 @@ static void m98088_eq_band(struct snd_soc_codec *codec, unsigned int dai,
621 unsigned int eq_reg; 621 unsigned int eq_reg;
622 unsigned int i; 622 unsigned int i;
623 623
624 BUG_ON(band > 4); 624 if (WARN_ON(band > 4) ||
625 BUG_ON(dai > 1); 625 WARN_ON(dai > 1))
626 return;
626 627
627 /* Load the base register address */ 628 /* Load the base register address */
628 eq_reg = dai ? M98088_REG_84_DAI2_EQ_BASE : M98088_REG_52_DAI1_EQ_BASE; 629 eq_reg = dai ? M98088_REG_84_DAI2_EQ_BASE : M98088_REG_52_DAI1_EQ_BASE;
@@ -962,7 +963,8 @@ static int max98088_line_pga(struct snd_soc_dapm_widget *w,
962 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 963 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
963 u8 *state; 964 u8 *state;
964 965
965 BUG_ON(!((channel == 1) || (channel == 2))); 966 if (WARN_ON(!(channel == 1 || channel == 2)))
967 return -EINVAL;
966 968
967 switch (line) { 969 switch (line) {
968 case LINE_INA: 970 case LINE_INA: