Commit cb1b1026 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: txx9: Use WARN_ON() instead of BUG_ON()

Use WARN_ON() and handle the error cases accordingly.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 5f29d445
...@@ -115,7 +115,7 @@ static void txx9aclc_dma_complete(void *arg) ...@@ -115,7 +115,7 @@ static void txx9aclc_dma_complete(void *arg)
spin_lock_irqsave(&dmadata->dma_lock, flags); spin_lock_irqsave(&dmadata->dma_lock, flags);
if (dmadata->frag_count >= 0) { if (dmadata->frag_count >= 0) {
dmadata->dmacount--; dmadata->dmacount--;
BUG_ON(dmadata->dmacount < 0); if (!WARN_ON(dmadata->dmacount < 0))
tasklet_schedule(&dmadata->tasklet); tasklet_schedule(&dmadata->tasklet);
} }
spin_unlock_irqrestore(&dmadata->dma_lock, flags); spin_unlock_irqrestore(&dmadata->dma_lock, flags);
...@@ -181,7 +181,10 @@ static void txx9aclc_dma_tasklet(unsigned long data) ...@@ -181,7 +181,10 @@ static void txx9aclc_dma_tasklet(unsigned long data)
spin_unlock_irqrestore(&dmadata->dma_lock, flags); spin_unlock_irqrestore(&dmadata->dma_lock, flags);
return; return;
} }
BUG_ON(dmadata->dmacount >= NR_DMA_CHAIN); if (WARN_ON(dmadata->dmacount >= NR_DMA_CHAIN)) {
spin_unlock_irqrestore(&dmadata->dma_lock, flags);
return;
}
while (dmadata->dmacount < NR_DMA_CHAIN) { while (dmadata->dmacount < NR_DMA_CHAIN) {
dmadata->dmacount++; dmadata->dmacount++;
spin_unlock_irqrestore(&dmadata->dma_lock, flags); spin_unlock_irqrestore(&dmadata->dma_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