diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-31 11:58:30 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-11-23 07:53:26 -0500 |
commit | 1c4a4f48a14861a567c8861355bc8252da3a003f (patch) | |
tree | 03285de0d6347b409f9691d32a36b61d7c1eac63 /arch | |
parent | 719301ff1c77b6da7b1b6f78a1e51af64a678619 (diff) |
ARM: dma-mapping: simplify page_to_dma() and __pfn_to_bus()
The non-highmem() and the __pfn_to_bus() based page_to_dma() both
compile to the same code, so its pointless having these two different
approaches. Use the __pfn_to_bus() based version.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-By: Jamie Iles <jamie@jamieiles.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/dma-mapping.h | 10 | ||||
-rw-r--r-- | arch/arm/include/asm/memory.h | 3 |
2 files changed, 2 insertions, 11 deletions
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index ff46dfa68a97..5d78eb163953 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -15,20 +15,10 @@ | |||
15 | * must not be used by drivers. | 15 | * must not be used by drivers. |
16 | */ | 16 | */ |
17 | #ifndef __arch_page_to_dma | 17 | #ifndef __arch_page_to_dma |
18 | |||
19 | #if !defined(CONFIG_HIGHMEM) | ||
20 | static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) | ||
21 | { | ||
22 | return (dma_addr_t)__virt_to_bus((unsigned long)page_address(page)); | ||
23 | } | ||
24 | #elif defined(__pfn_to_bus) | ||
25 | static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) | 18 | static inline dma_addr_t page_to_dma(struct device *dev, struct page *page) |
26 | { | 19 | { |
27 | return (dma_addr_t)__pfn_to_bus(page_to_pfn(page)); | 20 | return (dma_addr_t)__pfn_to_bus(page_to_pfn(page)); |
28 | } | 21 | } |
29 | #else | ||
30 | #error "this machine class needs to define __arch_page_to_dma to use HIGHMEM" | ||
31 | #endif | ||
32 | 22 | ||
33 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) | 23 | static inline void *dma_to_virt(struct device *dev, dma_addr_t addr) |
34 | { | 24 | { |
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index e0f8f4a4d45f..9099ada9da0c 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
@@ -200,7 +200,8 @@ static inline void *phys_to_virt(unsigned long x) | |||
200 | #ifndef __virt_to_bus | 200 | #ifndef __virt_to_bus |
201 | #define __virt_to_bus __virt_to_phys | 201 | #define __virt_to_bus __virt_to_phys |
202 | #define __bus_to_virt __phys_to_virt | 202 | #define __bus_to_virt __phys_to_virt |
203 | #define __pfn_to_bus(x) ((x) << PAGE_SHIFT) | 203 | #define __pfn_to_bus(x) __pfn_to_phys(x) |
204 | #define __bus_to_pfn(x) __phys_to_pfn(x) | ||
204 | #endif | 205 | #endif |
205 | 206 | ||
206 | static inline __deprecated unsigned long virt_to_bus(void *x) | 207 | static inline __deprecated unsigned long virt_to_bus(void *x) |