Skip to content

Commit

Permalink
swiotlb: use map_single instead of swiotlb_map_single in swiotlb_allo…
Browse files Browse the repository at this point in the history
…c_coherent

We always need swiotlb memory here so address_needs_mapping and
swiotlb_force testings are irrelevant. map_single should be used here
instead of swiotlb_map_single.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
FUJITA Tomonori authored and Ingo Molnar committed Sep 8, 2008
1 parent 68e91d6 commit 9dfda12
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,9 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
* swiotlb_map_single(), which will grab memory from
* the lowest available address range.
*/
dma_addr_t handle;
handle = swiotlb_map_single(NULL, NULL, size, DMA_FROM_DEVICE);
if (swiotlb_dma_mapping_error(hwdev, handle))
ret = map_single(hwdev, NULL, size, DMA_FROM_DEVICE);
if (!ret)
return NULL;

ret = bus_to_virt(handle);
}

memset(ret, 0, size);
Expand Down

0 comments on commit 9dfda12

Please sign in to comment.