From ab6197b5e87ce60ec25ec9f37193b9d668265522 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Tue, 19 Nov 2013 14:57:00 +0800 Subject: [PATCH] ENGR00288421-4 mxc: asrc: keep map/unmap parameters symmetic 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 Signed-off-by: Nicolin Chen --- drivers/mxc/asrc/mxc_asrc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mxc/asrc/mxc_asrc.c b/drivers/mxc/asrc/mxc_asrc.c index fcb2a5949d52..74507c6f555f 100644 --- a/drivers/mxc/asrc/mxc_asrc.c +++ b/drivers/mxc/asrc/mxc_asrc.c @@ -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(¶ms->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(¶ms->input_complete); complete(¶ms->lastperiod_complete); -- 2.39.5