summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-11-05 15:02:42 +0100
committerTakashi Iwai <tiwai@suse.de>2013-11-06 08:35:07 +0100
commit5a19b178d7b4dd162b3d4c7e729f30348f2eb177 (patch)
tree5e3c40f839b36f676b156c1314bacf9154f5b7b5
parent025be74c1db44158dd3cfe43b89ba16266d01062 (diff)
downloadlinux-5a19b178d7b4dd162b3d4c7e729f30348f2eb177.tar.bz2
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>
-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,
unsigned int period_size = snd_pcm_lib_period_bytes(substream);
unsigned int offset = period_size * (*periods_sent);
- BUG_ON(period_size >= (1 << 24));
+ if (WARN_ON(period_size >= (1 << 24)))
+ return;
if (dma_cont->request(dma_cont,
runtime->dma_addr + offset, period_size))
@@ -912,7 +913,8 @@ static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream)
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
CS4231_PLAYBACK_PIO);
- BUG_ON(runtime->period_size > 0xffff + 1);
+ if (WARN_ON(runtime->period_size > 0xffff + 1))
+ return -EINVAL;
chip->p_periods_sent = 0;
spin_unlock_irqrestore(&chip->lock, flags);