Skip to contentSkip to conversation

Subject: [PATCH 1/1] set invalid dma channel to -1 (and properly check for it) since 0 is not an invalid channel but -1 is.

PATCH Applied sware 2 participants 3 messages Dec 31, 2008 – Jan 1, 2009

Subsystems (3)
lore
Share & tools
lore

sware

author
#0 lore raw

Set the invalid dma channel to -1 (and check properly for it) in pxa2xx_pcm_hw_free(). Was assuming 0 is an invalid channel number but 0 is a valid pxa dma channel num.

---
 sound/soc/pxa/pxa2xx-pcm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/pxa/pxa2xx-pcm.c +2 -2
index c670d08..53b9fb1 100644
@@ -61,9 +61,9 @@ static int pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
 
 	__pxa2xx_pcm_hw_free(substream);
 
-	if (prtd->dma_ch) {
+	if (prtd->dma_ch >= 0) {
 		pxa_free_dma(prtd->dma_ch);
-		prtd->dma_ch = 0;
+		prtd->dma_ch = -1;
 	}
 
 	return 0;
Signature · 1 line
1.5.4.3
Applied
#1 lore raw
Quoted 4 lines · sware

Set the invalid dma channel to -1 (and check properly for it) in pxa2xx_pcm_hw_free(). Was assuming 0 is an invalid channel number but 0 is a valid pxa dma channel num.

Applied, thanks.

author
#2 lore raw

Thanks, everyone. Especially Mark for pointing the way to a proper git patch.

-stephen

Quoted 13 lines · Mark Brown
Quoted 7 lines · sware

Set the invalid dma channel to -1 (and check properly for it) in pxa2xx_pcm_hw_free(). Was assuming 0 is an invalid channel number but 0 is a valid pxa dma channel num.

Applied, thanks.