From: Takashi Iwai Date: Tue, 5 Nov 2013 17:39:49 +0000 (+0100) Subject: ASoC: max98088: Use WARN_ON() instead of BUG_ON() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bee026d0fe4bcc2b29e9279c319ed5e60a3bda97;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ASoC: max98088: Use WARN_ON() instead of BUG_ON() Use WARN_ON() and handle the error cases accordingly. Signed-off-by: Takashi Iwai Signed-off-by: Mark Brown --- 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, 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 ? 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, struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); u8 *state; - BUG_ON(!((channel == 1) || (channel == 2))); + if (WARN_ON(!(channel == 1 || channel == 2))) + return -EINVAL; switch (line) { case LINE_INA: