Browse Source

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>
Takashi Iwai 11 years ago
parent
commit
f5b3a56394
1 changed files with 2 additions and 1 deletions
  1. 2 1
      sound/soc/codecs/wm0010.c

+ 2 - 1
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 */