From fb2e3e70193f6757e536dfdecf21be2e6ee308d4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 5 Nov 2013 18:39:59 +0100 Subject: [PATCH] ASoC: wm9713: 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 --- sound/soc/codecs/wm9713.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index a53e175..acea892 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c @@ -221,7 +221,8 @@ static int wm9713_voice_shutdown(struct snd_soc_dapm_widget *w, struct snd_soc_codec *codec = w->codec; u16 status, rate; - BUG_ON(event != SND_SOC_DAPM_PRE_PMD); + if (WARN_ON(event != SND_SOC_DAPM_PRE_PMD)) + return -EINVAL; /* Gracefully shut down the voice interface. */ status = ac97_read(codec, AC97_EXTENDED_MID) | 0x1000; -- 2.7.4