From: Takashi Iwai Date: Tue, 5 Nov 2013 17:39:58 +0000 (+0100) Subject: ASoC: wm8904: Use WARN_ON() instead of BUG_ON() X-Git-Tag: v4.13~8446^2^2~4^2~18 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4c8d620ac9e3aea0a0c2edf36851b59b44bd12f2;p=mirror_ubuntu-bionic-kernel.git ASoC: wm8904: 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/wm8904.c b/sound/soc/codecs/wm8904.c index 4dfa8dceeabf..c173ab3cd18a 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -658,7 +658,8 @@ SOC_SINGLE_TLV("EQ5 Volume", WM8904_EQ6, 0, 24, 0, eq_tlv), static int cp_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { - BUG_ON(event != SND_SOC_DAPM_POST_PMU); + if (WARN_ON(event != SND_SOC_DAPM_POST_PMU)) + return -EINVAL; /* Maximum startup time */ udelay(500);