From: Stephen Ware Date: Wed, 31 Dec 2008 22:39:23 +0000 (-0800) Subject: ASoC: Fix pxa2xx-pcm checks for invalid DMA channels X-Git-Tag: v2.6.29-rc1~503^2~4^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=9bef6489d72abd8f598aede92be3854a69324c50;p=linux-2.6-omap-h63xx.git ASoC: Fix pxa2xx-pcm checks for invalid DMA channels 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. Signed-off-by: stephen Signed-off-by: Mark Brown --- diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index c670d08e7c9..53b9fb127a6 100644 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ b/sound/soc/pxa/pxa2xx-pcm.c @@ -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;