aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/max98088.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/max98088.c')
-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 66ceee22fdad..53d7dab4e054 100644
--- a/sound/soc/codecs/max98088.c
+++ b/sound/soc/codecs/max98088.c
@@ -568,8 +568,9 @@ static void m98088_eq_band(struct snd_soc_codec *codec, unsigned int dai,
568 unsigned int eq_reg; 568 unsigned int eq_reg;
569 unsigned int i; 569 unsigned int i;
570 570
571 BUG_ON(band > 4); 571 if (WARN_ON(band > 4) ||
572 BUG_ON(dai > 1); 572 WARN_ON(dai > 1))
573 return;
573 574
574 /* Load the base register address */ 575 /* Load the base register address */
575 eq_reg = dai ? M98088_REG_84_DAI2_EQ_BASE : M98088_REG_52_DAI1_EQ_BASE; 576 eq_reg = dai ? M98088_REG_84_DAI2_EQ_BASE : M98088_REG_52_DAI1_EQ_BASE;
@@ -909,7 +910,8 @@ static int max98088_line_pga(struct snd_soc_dapm_widget *w,
909 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); 910 struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec);
910 u8 *state; 911 u8 *state;
911 912
912 BUG_ON(!((channel == 1) || (channel == 2))); 913 if (WARN_ON(!(channel == 1 || channel == 2)))
914 return -EINVAL;
913 915
914 switch (line) { 916 switch (line) {
915 case LINE_INA: 917 case LINE_INA: