ASoC: pxa: Use WARN_ON() instead of BUG_ON()
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Nov 2013 17:40:03 +0000 (18:40 +0100)
committerMark Brown <broonie@linaro.org>
Thu, 7 Nov 2013 19:55:15 +0000 (19:55 +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/pxa/pxa2xx-i2s.c

index d5340a088858eff3f8a8b578a38a2ea3e7476bf1..c0d648d3339f2ab75c622cedd91f7af78e00b40f 100644 (file)
@@ -165,7 +165,8 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
 {
        struct snd_dmaengine_dai_dma_data *dma_data;
 
-       BUG_ON(IS_ERR(clk_i2s));
+       if (WARN_ON(IS_ERR(clk_i2s)))
+               return -EINVAL;
        clk_prepare_enable(clk_i2s);
        clk_ena = 1;
        pxa_i2s_wait();