Commit 5a19b178 authored by Takashi Iwai's avatar Takashi Iwai

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 025be74c
...@@ -429,7 +429,8 @@ static void snd_cs4231_advance_dma(struct cs4231_dma_control *dma_cont, ...@@ -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 period_size = snd_pcm_lib_period_bytes(substream);
unsigned int offset = period_size * (*periods_sent); 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, if (dma_cont->request(dma_cont,
runtime->dma_addr + offset, period_size)) runtime->dma_addr + offset, period_size))
...@@ -912,7 +913,8 @@ static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream) ...@@ -912,7 +913,8 @@ static int snd_cs4231_playback_prepare(struct snd_pcm_substream *substream)
chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE | chip->image[CS4231_IFACE_CTRL] &= ~(CS4231_PLAYBACK_ENABLE |
CS4231_PLAYBACK_PIO); 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; chip->p_periods_sent = 0;
spin_unlock_irqrestore(&chip->lock, flags); spin_unlock_irqrestore(&chip->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment