aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/max98095.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-05 12:39:50 -0500
committerMark Brown <broonie@linaro.org>2013-11-06 05:26:16 -0500
commita922cd7151371f429c7456951b77999c75520955 (patch)
treee4e41d522842fb9561df2379304c1fcc0463652b /sound/soc/codecs/max98095.c
parentbee026d0fe4bcc2b29e9279c319ed5e60a3bda97 (diff)
ASoC: max98095: 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/soc/codecs/max98095.c')
-rw-r--r--sound/soc/codecs/max98095.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 8dbcacd44e6a..04618a5f2a6f 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -637,8 +637,9 @@ static void m98095_eq_band(struct snd_soc_codec *codec, unsigned int dai,
637 unsigned int eq_reg; 637 unsigned int eq_reg;
638 unsigned int i; 638 unsigned int i;
639 639
640 BUG_ON(band > 4); 640 if (WARN_ON(band > 4) ||
641 BUG_ON(dai > 1); 641 WARN_ON(dai > 1))
642 return;
642 643
643 /* Load the base register address */ 644 /* Load the base register address */
644 eq_reg = dai ? M98095_142_DAI2_EQ_BASE : M98095_110_DAI1_EQ_BASE; 645 eq_reg = dai ? M98095_142_DAI2_EQ_BASE : M98095_110_DAI1_EQ_BASE;
@@ -662,8 +663,9 @@ static void m98095_biquad_band(struct snd_soc_codec *codec, unsigned int dai,
662 unsigned int bq_reg; 663 unsigned int bq_reg;
663 unsigned int i; 664 unsigned int i;
664 665
665 BUG_ON(band > 1); 666 if (WARN_ON(band > 1) ||
666 BUG_ON(dai > 1); 667 WARN_ON(dai > 1))
668 return;
667 669
668 /* Load the base register address */ 670 /* Load the base register address */
669 bq_reg = dai ? M98095_17E_DAI2_BQ_BASE : M98095_174_DAI1_BQ_BASE; 671 bq_reg = dai ? M98095_17E_DAI2_BQ_BASE : M98095_174_DAI1_BQ_BASE;
@@ -1011,7 +1013,8 @@ static int max98095_line_pga(struct snd_soc_dapm_widget *w,
1011 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 1013 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
1012 u8 *state; 1014 u8 *state;
1013 1015
1014 BUG_ON(!((channel == 1) || (channel == 2))); 1016 if (WARN_ON(!(channel == 1 || channel == 2)))
1017 return -EINVAL;
1015 1018
1016 state = &max98095->lin_state; 1019 state = &max98095->lin_state;
1017 1020
@@ -1868,7 +1871,8 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol,
1868 int fs, best, best_val, i; 1871 int fs, best, best_val, i;
1869 int regmask, regsave; 1872 int regmask, regsave;
1870 1873
1871 BUG_ON(channel > 1); 1874 if (WARN_ON(channel > 1))
1875 return -EINVAL;
1872 1876
1873 if (!pdata || !max98095->eq_textcnt) 1877 if (!pdata || !max98095->eq_textcnt)
1874 return 0; 1878 return 0;