diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-07-09 21:04:52 -0400 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-07-28 01:19:18 -0400 |
commit | cf56e3f2e8a8d5b7bc719980869b0e7985c256f3 (patch) | |
tree | 36b594be25cf278243bd79ed932f2362ff71afef /lib/swiotlb.c | |
parent | bb52196be37ce154ddc50b1f39496146d181cbe7 (diff) |
swiotlb: remove swiotlb_arch_range_needs_mapping
Nobody uses swiotlb_arch_range_needs_mapping().
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Becky Bruce <beckyb@kernel.crashing.org>
Diffstat (limited to 'lib/swiotlb.c')
-rw-r--r-- | lib/swiotlb.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 3c4c21cdf43d..dc1cd1f5369e 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -141,11 +141,6 @@ int __weak swiotlb_arch_address_needs_mapping(struct device *hwdev, | |||
141 | return !is_buffer_dma_capable(dma_get_mask(hwdev), addr, size); | 141 | return !is_buffer_dma_capable(dma_get_mask(hwdev), addr, size); |
142 | } | 142 | } |
143 | 143 | ||
144 | int __weak swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size) | ||
145 | { | ||
146 | return 0; | ||
147 | } | ||
148 | |||
149 | static void swiotlb_print_info(unsigned long bytes) | 144 | static void swiotlb_print_info(unsigned long bytes) |
150 | { | 145 | { |
151 | phys_addr_t pstart, pend; | 146 | phys_addr_t pstart, pend; |
@@ -312,11 +307,6 @@ address_needs_mapping(struct device *hwdev, dma_addr_t addr, size_t size) | |||
312 | return swiotlb_arch_address_needs_mapping(hwdev, addr, size); | 307 | return swiotlb_arch_address_needs_mapping(hwdev, addr, size); |
313 | } | 308 | } |
314 | 309 | ||
315 | static inline int range_needs_mapping(phys_addr_t paddr, size_t size) | ||
316 | { | ||
317 | return swiotlb_force || swiotlb_arch_range_needs_mapping(paddr, size); | ||
318 | } | ||
319 | |||
320 | static int is_swiotlb_buffer(char *addr) | 310 | static int is_swiotlb_buffer(char *addr) |
321 | { | 311 | { |
322 | return addr >= io_tlb_start && addr < io_tlb_end; | 312 | return addr >= io_tlb_start && addr < io_tlb_end; |
@@ -646,8 +636,7 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, | |||
646 | * we can safely return the device addr and not worry about bounce | 636 | * we can safely return the device addr and not worry about bounce |
647 | * buffering it. | 637 | * buffering it. |
648 | */ | 638 | */ |
649 | if (!address_needs_mapping(dev, dev_addr, size) && | 639 | if (!address_needs_mapping(dev, dev_addr, size) && !swiotlb_force) |
650 | !range_needs_mapping(phys, size)) | ||
651 | return dev_addr; | 640 | return dev_addr; |
652 | 641 | ||
653 | /* | 642 | /* |
@@ -810,7 +799,7 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems, | |||
810 | phys_addr_t paddr = sg_phys(sg); | 799 | phys_addr_t paddr = sg_phys(sg); |
811 | dma_addr_t dev_addr = swiotlb_phys_to_bus(hwdev, paddr); | 800 | dma_addr_t dev_addr = swiotlb_phys_to_bus(hwdev, paddr); |
812 | 801 | ||
813 | if (range_needs_mapping(paddr, sg->length) || | 802 | if (swiotlb_force || |
814 | address_needs_mapping(hwdev, dev_addr, sg->length)) { | 803 | address_needs_mapping(hwdev, dev_addr, sg->length)) { |
815 | void *map = map_single(hwdev, sg_phys(sg), | 804 | void *map = map_single(hwdev, sg_phys(sg), |
816 | sg->length, dir); | 805 | sg->length, dir); |