aboutsummaryrefslogtreecommitdiffstats
path: root/sound/sparc
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-05 09:02:42 -0500
committerTakashi Iwai <tiwai@suse.de>2013-11-06 02:35:07 -0500
commit5a19b178d7b4dd162b3d4c7e729f30348f2eb177 (patch)
tree5e3c40f839b36f676b156c1314bacf9154f5b7b5 /sound/sparc
parent025be74c1db44158dd3cfe43b89ba16266d01062 (diff)
ALSA: sparc/cs4231: Use WARN_ON() instead of BUG_ON()
BUG_ON() is rather useless for debugging as it leads to panic(). Use WARN_ON() and handle the error cases accordingly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/sparc')
-rw-r--r--sound/sparc/cs4231.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index 54aaad2a10f5..b47f6fe6277f 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -429,7 +429,8 @@ static void snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont,
429 unsigned int period_size = snd_pcm_lib_period_bytes(substream); 429 unsigned int period_size = snd_pcm_lib_period_bytes(substream);
430 unsigned int offset = period_size * (*periods_sent); 430 unsigned int offset = period_size * (*periods_sent);
431 431
432 BUG_ON(period_size >= (1 << 24)); 432 if (WARN_ON(period_size >= (1 << 24)))
433 return;
433 434
434 if (dma_cont->request(dma_cont, 435 if (dma_cont->request(dma_cont,
435 runtime->dma_addr + offset, period_size)) 436 runtime->dma_addr + offset, period_size))
@@ -912,7 +913,8 @@ static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream)
912 chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE | 913 chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
913 CS4231_PLAYBACK_PIO); 914 CS4231_PLAYBACK_PIO);
914 915
915 BUG_ON(runtime->period_size > 0xffff + 1); 916 if (WARN_ON(runtime->period_size > 0xffff + 1))
917 return -EINVAL;
916 918
917 chip->p_periods_sent = 0; 919 chip->p_periods_sent = 0;
918 spin_unlock_irqrestore(&chip->lock, flags); 920 spin_unlock_irqrestore(&chip->lock, flags);