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

index d5ebcb00019b7b807d9ad7e3940333c5ad2a4c4f..aea916431227834ea1d8a2dcd6a972b8625bc4ac 100644 (file)
@@ -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 */