From: James Hogan Date: Fri, 23 Nov 2012 16:13:05 +0000 (+0000) Subject: asm-generic/io.h: check CONFIG_VIRT_TO_BUS X-Git-Tag: next-20130218~110^2~59 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a4267a0a5e081a60f4754de86ef4cc388592dd51;p=karo-tx-linux.git 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 Acked-by: Arnd Bergmann --- diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 33bbbae4ddc6..cc76b3ecd206 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h @@ -332,6 +332,7 @@ extern void ioport_unmap(void __iomem *p); #define xlate_dev_kmem_ptr(p) p #define xlate_dev_mem_ptr(p) __va(p) +#ifdef CONFIG_VIRT_TO_BUS #ifndef virt_to_bus static inline unsigned long virt_to_bus(volatile void *address) { @@ -343,6 +344,7 @@ static inline void *bus_to_virt(unsigned long address) return (void *) address; } #endif +#endif #ifndef memset_io #define memset_io(a, b, c) memset(__io_virt(a), (b), (c))