From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 5 Nov 2013 17:39:52 +0000 (+0100)
Subject: ASoC: wm0010: Use WARN_ON() instead of BUG_ON()
X-Git-Tag: firefly_0821_release~176^2~4889^2~33^2~4^2~24
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f5b3a563943f415b99823be9918119f07337e328;p=firefly-linux-kernel-4.4.55.git

ASoC: wm0010: Use WARN_ON() instead of BUG_ON()

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>
---

diff --git a/sound/soc/codecs/wm0010.c b/sound/soc/codecs/wm0010.c
index d5ebcb00019b..aea916431227 100644
--- a/sound/soc/codecs/wm0010.c
+++ b/sound/soc/codecs/wm0010.c
@@ -372,7 +372,8 @@ static int wm0010_firmware_load(const char *name, struct snd_soc_codec *codec)
 	offset = 0;
 	dsp = inforec->dsp_target;
 	wm0010->boot_failed = false;
-	BUG_ON(!list_empty(&xfer_list));
+	if (WARN_ON(!list_empty(&xfer_list)))
+		return -EINVAL;
 	init_completion(&done);
 
 	/* First record should be INFO */