提交 713a7462 编写于 作者: C Christoph Hellwig

arc: simplify arc_dma_sync_single_for_{cpu,device}

Remove the indirection through _dma_cache_sync.  Also move the functions
up a bit in the source file as we'll need them in more places soon.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Tested-by: NAlexey Brodkin <abrodkin@synopsys.com>
Acked-by: NVineet Gupta <vgupta@synopsys.com>
上级 782e6769
...@@ -153,6 +153,18 @@ static void _dma_cache_sync(phys_addr_t paddr, size_t size, ...@@ -153,6 +153,18 @@ static void _dma_cache_sync(phys_addr_t paddr, size_t size,
} }
} }
static void arc_dma_sync_single_for_device(struct device *dev,
dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
{
dma_cache_wback(dma_handle, size);
}
static void arc_dma_sync_single_for_cpu(struct device *dev,
dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
{
dma_cache_inv(dma_handle, size);
}
/* /*
* arc_dma_map_page - map a portion of a page for streaming DMA * arc_dma_map_page - map a portion of a page for streaming DMA
* *
...@@ -221,18 +233,6 @@ static void arc_dma_unmap_sg(struct device *dev, struct scatterlist *sg, ...@@ -221,18 +233,6 @@ static void arc_dma_unmap_sg(struct device *dev, struct scatterlist *sg,
attrs); attrs);
} }
static void arc_dma_sync_single_for_cpu(struct device *dev,
dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
{
_dma_cache_sync(dma_handle, size, DMA_FROM_DEVICE);
}
static void arc_dma_sync_single_for_device(struct device *dev,
dma_addr_t dma_handle, size_t size, enum dma_data_direction dir)
{
_dma_cache_sync(dma_handle, size, DMA_TO_DEVICE);
}
static void arc_dma_sync_sg_for_cpu(struct device *dev, static void arc_dma_sync_sg_for_cpu(struct device *dev,
struct scatterlist *sglist, int nelems, struct scatterlist *sglist, int nelems,
enum dma_data_direction dir) enum dma_data_direction dir)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册