Commit 9bef6489d72abd8f598aede92be3854a69324c50

Authored by Stephen Ware
Committed by Mark Brown
1 parent 276c62225a

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 <stephen.ware@eqware.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

sound/soc/pxa/pxa2xx-pcm.c
... ... @@ -61,9 +61,9 @@
61 61  
62 62 __pxa2xx_pcm_hw_free(substream);
63 63  
64   - if (prtd->dma_ch) {
  64 + if (prtd->dma_ch >= 0) {
65 65 pxa_free_dma(prtd->dma_ch);
66   - prtd->dma_ch = 0;
  66 + prtd->dma_ch = -1;
67 67 }
68 68  
69 69 return 0;