diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-18 15:14:28 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-19 08:46:12 +0200 |
commit | 713a74624bba6c449213b6a7a2ab0065f6e2c7c9 (patch) | |
tree | 1346178d77cb9014b78f2fcff1a76b6b7eb002d4 /arch/arc/mm | |
parent | 782e6769c0df744e773dc2acff71c974b3bba4e9 (diff) |
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: Christoph Hellwig <hch@lst.de>
Tested-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/mm')
-rw-r--r-- | arch/arc/mm/dma.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c index 1dcc404b5aec..98e21ce526be 100644 --- a/arch/arc/mm/dma.c +++ b/arch/arc/mm/dma.c @@ -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 * @@ -221,18 +233,6 @@ static void arc_dma_unmap_sg(struct device *dev, struct scatterlist *sg, 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, struct scatterlist *sglist, int nelems, enum dma_data_direction dir) |