diff options
author | Mark Brown <broonie@linaro.org> | 2013-11-08 10:43:41 +0000 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-08 10:43:41 +0000 |
commit | 108145a60675ebc0e42e7964ee6666096bbf86ce (patch) | |
tree | 19266ab0500d7bb188eb53634d484054d59473d2 /sound/soc/codecs/max98095.c | |
parent | 022aa51e3fda0b3c6688defaa859961c11c36ec8 (diff) | |
parent | bf4edea863c435c302041cf8bb01c8b3ca729449 (diff) | |
download | op-kernel-dev-108145a60675ebc0e42e7964ee6666096bbf86ce.zip op-kernel-dev-108145a60675ebc0e42e7964ee6666096bbf86ce.tar.gz |
Merge remote-tracking branch 'asoc/topic/warn' into asoc-next
Diffstat (limited to 'sound/soc/codecs/max98095.c')
-rw-r--r-- | sound/soc/codecs/max98095.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 8fb0724..6724431 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -516,8 +516,9 @@ static void m98095_eq_band(struct snd_soc_codec *codec, unsigned int dai, unsigned int eq_reg; unsigned int i; - BUG_ON(band > 4); - BUG_ON(dai > 1); + if (WARN_ON(band > 4) || + WARN_ON(dai > 1)) + return; /* Load the base register address */ eq_reg = dai ? M98095_142_DAI2_EQ_BASE : M98095_110_DAI1_EQ_BASE; @@ -541,8 +542,9 @@ static void m98095_biquad_band(struct snd_soc_codec *codec, unsigned int dai, unsigned int bq_reg; unsigned int i; - BUG_ON(band > 1); - BUG_ON(dai > 1); + if (WARN_ON(band > 1) || + WARN_ON(dai > 1)) + return; /* Load the base register address */ bq_reg = dai ? M98095_17E_DAI2_BQ_BASE : M98095_174_DAI1_BQ_BASE; @@ -890,7 +892,8 @@ static int max98095_line_pga(struct snd_soc_dapm_widget *w, struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); u8 *state; - BUG_ON(!((channel == 1) || (channel == 2))); + if (WARN_ON(!(channel == 1 || channel == 2))) + return -EINVAL; state = &max98095->lin_state; @@ -1740,7 +1743,8 @@ static int max98095_put_eq_enum(struct snd_kcontrol *kcontrol, int fs, best, best_val, i; int regmask, regsave; - BUG_ON(channel > 1); + if (WARN_ON(channel > 1)) + return -EINVAL; if (!pdata || !max98095->eq_textcnt) return 0; |