ASoC: wm8996: Replace BUG() with WARN()
authorTakashi Iwai <tiwai@suse.de>
Wed, 6 Nov 2013 10:07:17 +0000 (11:07 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 7 Nov 2013 19:55:20 +0000 (19:55 +0000)
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation.  For that
purpose, it'd be more convenient to use WARN() instead with more
error information.

Cc: patches@opensource.wolfsonmicro.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/codecs/wm8996.c

index 46fe83d2b2242610799180edd6774c0dc3cfe674..d666de03704a16051234c5b2ea236854c28480be 100644 (file)
@@ -608,7 +608,7 @@ static int bg_event(struct snd_soc_dapm_widget *w,
                wm8996_bg_disable(codec);
                break;
        default:
-               BUG();
+               WARN(1, "Invalid event %d\n", event);
                ret = -EINVAL;
        }
 
@@ -625,7 +625,7 @@ static int cp_event(struct snd_soc_dapm_widget *w,
                msleep(5);
                break;
        default:
-               BUG();
+               WARN(1, "Invalid event %d\n", event);
                ret = -EINVAL;
        }
 
@@ -646,7 +646,7 @@ static int rmv_short_event(struct snd_soc_dapm_widget *w,
                wm8996->hpout_pending |= w->shift;
                break;
        default:
-               BUG();
+               WARN(1, "Invalid event %d\n", event);
                return -EINVAL;
        }
 
@@ -767,7 +767,7 @@ static int dcs_start(struct snd_soc_dapm_widget *w,
                wm8996->dcs_pending |= 1 << w->shift;
                break;
        default:
-               BUG();
+               WARN(1, "Invalid event %d\n", event);
                return -EINVAL;
        }
 
@@ -1656,7 +1656,7 @@ static int wm8996_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
                lrclk_rx_reg = WM8996_AIF2_RX_LRCLK_2;
                break;
        default:
-               BUG();
+               WARN(1, "Invalid dai id %d\n", dai->id);
                return -EINVAL;
        }
 
@@ -1768,7 +1768,7 @@ static int wm8996_hw_params(struct snd_pcm_substream *substream,
                dsp_shift = WM8996_DSP2_DIV_SHIFT;
                break;
        default:
-               BUG();
+               WARN(1, "Invalid dai id %d\n", dai->id);
                return -EINVAL;
        }