ASoC: Tegra: Fix error handling in DMA channel alloc
authorStephen Warren <swarren@nvidia.com>
Wed, 23 Feb 2011 03:16:34 +0000 (20:16 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 28 Feb 2011 15:10:03 +0000 (15:10 +0000)
tegra_dma_allocate_channel() returns NULL on errors, not an error pointer.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/tegra/tegra_pcm.c

index 40540b175f5ee82d62a0c5721eeefcf33f3b001a..3c271f9535829af6e8b102095896adc08e581774 100644 (file)
@@ -161,8 +161,8 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
        prtd->dma_req[1].dev = prtd;
 
        prtd->dma_chan = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT);
-       if (IS_ERR(prtd->dma_chan)) {
-               ret = PTR_ERR(prtd->dma_chan);
+       if (prtd->dma_chan == NULL) {
+               ret = -ENOMEM;
                goto err;
        }