]> git.karo-electronics.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)
committerNicolin Chen <b42378@freescale.com>
Tue, 19 Nov 2013 10:04:57 +0000 (18:04 +0800)
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 377de8f90725e1740bff4db12343dc7e86950ee9..7c1dd8fd3076e0c327aa682a13d6447c7aeebbf9 100644 (file)
@@ -668,7 +668,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);
 }
@@ -797,7 +797,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);
        if (!last_period->dma_vaddr) {
@@ -1146,7 +1146,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);