aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2013-02-07 08:58:35 -0500
committerMichal Simek <michal.simek@xilinx.com>2013-02-12 05:29:46 -0500
commit711e5b4520986380700e6f095608021cf087170e (patch)
tree6ecfbf3fcbd3bf5bbd71b03521d66815161d41f3 /include/asm-generic
parentd64af918feb6cb81c396d6d2dabb738bc51dda3f (diff)
asm-generic: io: Fix ioread16/32be and iowrite16/32be
Fix ioreadXXbe and iowriteXXbe functions which did additional little endian conversion on native big endian systems. Using be_to_cpu (cpu_to_be) conversions with __raw_read/write functions have resolved it. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Will Deacon <will.deacon@arm.com> CC: linux-arch@vger.kernel.org
Diffstat (limited to 'include/asm-generic')
-rw-r--r--include/asm-generic/io.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 33bbbae4ddc6..8823581cf1cd 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -225,15 +225,15 @@ static inline void outsl(unsigned long addr, const void *buffer, int count)
225#ifndef CONFIG_GENERIC_IOMAP 225#ifndef CONFIG_GENERIC_IOMAP
226#define ioread8(addr) readb(addr) 226#define ioread8(addr) readb(addr)
227#define ioread16(addr) readw(addr) 227#define ioread16(addr) readw(addr)
228#define ioread16be(addr) be16_to_cpu(ioread16(addr)) 228#define ioread16be(addr) __be16_to_cpu(__raw_readw(addr))
229#define ioread32(addr) readl(addr) 229#define ioread32(addr) readl(addr)
230#define ioread32be(addr) be32_to_cpu(ioread32(addr)) 230#define ioread32be(addr) __be32_to_cpu(__raw_readl(addr))
231 231
232#define iowrite8(v, addr) writeb((v), (addr)) 232#define iowrite8(v, addr) writeb((v), (addr))
233#define iowrite16(v, addr) writew((v), (addr)) 233#define iowrite16(v, addr) writew((v), (addr))
234#define iowrite16be(v, addr) iowrite16(be16_to_cpu(v), (addr)) 234#define iowrite16be(v, addr) __raw_writew(__cpu_to_be16(v), addr)
235#define iowrite32(v, addr) writel((v), (addr)) 235#define iowrite32(v, addr) writel((v), (addr))
236#define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr)) 236#define iowrite32be(v, addr) __raw_writel(__cpu_to_be32(v), addr)
237 237
238#define ioread8_rep(p, dst, count) \ 238#define ioread8_rep(p, dst, count) \
239 insb((unsigned long) (p), (dst), (count)) 239 insb((unsigned long) (p), (dst), (count))