]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00288421-4 mxc: asrc: keep map/unmap parameters symmetic
authorNicolin Chen <b42378@freescale.com>
Tue, 19 Nov 2013 06:57:00 +0000 (14:57 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:43 +0000 (10:06 +0200)
We are using DEV_TO_MEM for dma_map but MEM_TO_DEV for dma_unmap, thus fix it.
It also adds missing device pointer since assigning it to dma_free_coherent().

Acked-by: Wang Shengjiu <b02247@freescale.com>
Signed-off-by: Nicolin Chen <b42378@freescale.com>
drivers/mxc/asrc/mxc_asrc.c

index fcb2a5949d52111ed8c50535a592853b105443f8..74507c6f555f561f6d27738deaaa65fdbfef3e6c 100644 (file)
@@ -735,7 +735,7 @@ static void asrc_output_dma_callback(void *data)
        struct asrc_pair_params *params = (struct asrc_pair_params *)data;
 
        dma_unmap_sg(NULL, params->output_sg, params->output_sg_nodes,
-                       DMA_MEM_TO_DEV);
+                       DMA_DEV_TO_MEM);
 
        complete(&params->output_complete);
 }
@@ -881,7 +881,7 @@ static int mxc_allocate_dma_buf(struct asrc_pair_params *params)
        }
        output_a->dma_paddr = virt_to_dma(NULL, output_a->dma_vaddr);
 
-       last_period->dma_vaddr = dma_alloc_coherent(NULL,
+       last_period->dma_vaddr = dma_alloc_coherent(asrc->dev,
                        1024 * params->last_period_sample,
                        &last_period->dma_paddr, GFP_KERNEL);
 
@@ -1219,7 +1219,7 @@ static void asrc_polling_debug(struct asrc_pair_params *params)
        dma_unmap_sg(NULL, params->input_sg, params->input_sg_nodes,
                        DMA_MEM_TO_DEV);
        dma_unmap_sg(NULL, params->output_sg, params->output_sg_nodes,
-                       DMA_MEM_TO_DEV);
+                       DMA_DEV_TO_MEM);
 
        complete(&params->input_complete);
        complete(&params->lastperiod_complete);