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

index a53e175..acea892 100644 (file)
@@ -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;