aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Hogan2012-11-23 10:13:05 -0600
committerJames Hogan2013-03-02 14:09:14 -0600
commitc93d03123169357afde2d9b20dfbf9675295668f (patch)
tree88f05b0859830c331cfbff0c1908ac701d8e2a06 /include
parent19f949f52599ba7c3f67a5897ac6be14bfcb1200 (diff)
downloadam43-linux-kernel-c93d03123169357afde2d9b20dfbf9675295668f.tar.gz
am43-linux-kernel-c93d03123169357afde2d9b20dfbf9675295668f.tar.xz
am43-linux-kernel-c93d03123169357afde2d9b20dfbf9675295668f.zip
asm-generic/io.h: check CONFIG_VIRT_TO_BUS
Make asm-generic/io.h check CONFIG_VIRT_TO_BUS before defining virt_to_bus() and bus_to_virt(), otherwise it's easy to accidentally have a silently failing incorrect direct mapped definition rather then no definition at all. Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/io.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 33bbbae4ddc..cc76b3ecd20 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -332,6 +332,7 @@ extern void ioport_unmap(void __iomem *p);
332#define xlate_dev_kmem_ptr(p) p 332#define xlate_dev_kmem_ptr(p) p
333#define xlate_dev_mem_ptr(p) __va(p) 333#define xlate_dev_mem_ptr(p) __va(p)
334 334
335#ifdef CONFIG_VIRT_TO_BUS
335#ifndef virt_to_bus 336#ifndef virt_to_bus
336static inline unsigned long virt_to_bus(volatile void *address) 337static inline unsigned long virt_to_bus(volatile void *address)
337{ 338{
@@ -343,6 +344,7 @@ static inline void *bus_to_virt(unsigned long address)
343 return (void *) address; 344 return (void *) address;
344} 345}
345#endif 346#endif
347#endif
346 348
347#ifndef memset_io 349#ifndef memset_io
348#define memset_io(a, b, c) memset(__io_virt(a), (b), (c)) 350#define memset_io(a, b, c) memset(__io_virt(a), (b), (c))