ASoC: Wrong variable returned on error
authorRoel Kluin <roel.kluin@gmail.com>
Tue, 8 Dec 2009 00:34:22 +0000 (01:34 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 8 Dec 2009 12:46:11 +0000 (12:46 +0000)
The wrong variable was returned in the case of an error

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/imx/mx1_mx2-pcm.c

index b83866529397eb37aacf342ab8ed17a70fba1b8e..bffffcd5ff349036824f499c0a272601010a227c 100644 (file)
@@ -322,12 +322,12 @@ static int mx1_mx2_pcm_open(struct snd_pcm_substream *substream)
 
        pr_debug("%s: Requesting dma channel (%s)\n", __func__,
                                                prtd->dma_params->name);
-       prtd->dma_ch = imx_dma_request_by_prio(prtd->dma_params->name,
-                                               DMA_PRIO_HIGH);
-       if (prtd->dma_ch < 0) {
+       ret = imx_dma_request_by_prio(prtd->dma_params->name, DMA_PRIO_HIGH);
+       if (ret < 0) {
                printk(KERN_ERR "Error %d requesting dma channel\n", ret);
                return ret;
        }
+       prtd->dma_ch = ret;
        imx_dma_config_burstlen(prtd->dma_ch,
                                prtd->dma_params->watermark_level);