Skip to content

Commit

Permalink
ASoC: Fix pxa2xx-pcm checks for invalid DMA channels
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Ware authored and Mark Brown committed Jan 1, 2009
1 parent 276c622 commit 9bef648
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/pxa/pxa2xx-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9bef648

Please sign in to comment.