[PATCH 1/3] imx: make IMX_IO_ADDRESS assembly compatible
Baruch Siach
baruch at tkos.co.il
Tue Mar 16 02:35:37 EDT 2010
The IMX_IO_ADDRESS macro may be used directly on indirectly in assembly code.
Make it assembly compatible by using the IOMEM helper macro.
Signed-off-by: Baruch Siach <baruch at tkos.co.il>
---
arch/arm/plat-mxc/include/mach/hardware.h | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h
index ebadf4a..f75a5cc 100644
--- a/arch/arm/plat-mxc/include/mach/hardware.h
+++ b/arch/arm/plat-mxc/include/mach/hardware.h
@@ -22,10 +22,18 @@
#include <asm/sizes.h>
-#define IMX_IO_ADDRESS(addr, module) \
- ((void __force __iomem *) \
- (((unsigned long)((addr) - (module ## _BASE_ADDR)) < module ## _SIZE) ?\
- (addr) - (module ## _BASE_ADDR) + (module ## _BASE_ADDR_VIRT) : 0))
+#ifdef __ASSEMBLER__
+#define IOMEM(addr,base,size,virt) ((addr) - (base) + (virt))
+#else
+#define IOMEM(addr,base,size,virt) \
+ ((void __force __iomem *) \
+ ((unsigned long) ((addr) - (base)) < size) ? \
+ (addr) - (base) + (virt) : 0)
+#endif
+
+#define IMX_IO_ADDRESS(addr, module) \
+ IOMEM(addr, module ## _BASE_ADDR, module ## _SIZE, \
+ module ## _BASE_ADDR_VIRT)
#ifdef CONFIG_ARCH_MX5
#include <mach/mx51.h>
--
1.7.0
More information about the linux-arm-kernel
mailing list