From 700ffac35f619cc4a05708eb59688ad2ceac4cae Mon Sep 17 00:00:00 2001 From: Santosh Shukla Date: Wed, 22 Oct 2014 18:10:32 +0530 Subject: MTD: MAP: _relaxed build fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit noticed build break on x86 In file included from drivers/mtd/chips/chipreg.c:11:0: include/linux/mtd/map.h: In function ‘inline_map_write’: include/linux/mtd/map.h:420:3: error: implicit declaration of function ‘writeb_relaxed’ [-Werror=implicit-function-declaration] writeb_relaxed(datum.x[0], map->virt + ofs); ^ include/linux/mtd/map.h:422:3: error: implicit declaration of function ‘writew_relaxed’ [-Werror=implicit-function-declaration] writew_relaxed(datum.x[0], map->virt + ofs); ^ include/linux/mtd/map.h:424:3: error: implicit declaration of function ‘writel_relaxed’ [-Werror=implicit-function-declaration] writel_relaxed(datum.x[0], map->virt + ofs); This commit breaks for x86: commit 1e885fabb4b148110c43056dd16842d11cde11db Author: Victor Kamensky Date: Mon Jul 29 22:03:27 2013 -0700 mtd: map.h endian fix Need to use endian neutral functions to read/write LE h/w registers. I.e insted of __raw_readl and _raw_writel, readl_relaxed and writel_relaxed. If the first just read/write register with memory barrier, the second will byteswap it if host operates in BE mode. Signed-off-by: Victor Kamensky Signed-off-by: Santosh Shukla Signed-off-by: Gary S. Robertson --- arch/x86/include/asm/io.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 91d9c69a629e..f5d272423695 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -77,6 +77,10 @@ build_mmio_write(__writel, "l", unsigned int, "r", ) #define __raw_writew __writew #define __raw_writel __writel +#define writeb_relaxed __writeb +#define writew_relaxed __writew +#define writel_relaxed __writel + #define mmiowb() barrier() #ifdef CONFIG_X86_64 -- cgit v1.2.3