ASoC: wm8904: Use WARN_ON() instead of BUG_ON()
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Nov 2013 17:39:58 +0000 (18:39 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 6 Nov 2013 10:26:59 +0000 (10:26 +0000)
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>
sound/soc/codecs/wm8904.c

index 4dfa8dceeabf5725b1cb9dc6c7aab6d0619242e7..c173ab3cd18a276d5a3c55e500a8bbdb758732bd 100644 (file)
@@ -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);