Commit d092a870 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

arch: rely on asm-generic/io.h for default ioremap_* definitions



Various architectures that use asm-generic/io.h still defined their
own default versions of ioremap_nocache, ioremap_wt and ioremap_wc
that point back to plain ioremap directly or indirectly.  Remove these
definitions and rely on asm-generic/io.h instead.  For this to work
the backup ioremap_* defintions needs to be changed to purely cpp
macros instea of inlines to cover for architectures like openrisc
that only define ioremap after including <asm-generic/io.h>.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarPalmer Dabbelt <palmer@dabbelt.com>
parent 97c9801a
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -34,10 +34,6 @@ static inline void ioport_unmap(void __iomem *addr)

extern void iounmap(const void __iomem *addr);

#define ioremap_nocache(phy, sz)	ioremap(phy, sz)
#define ioremap_wc(phy, sz)		ioremap(phy, sz)
#define ioremap_wt(phy, sz)		ioremap(phy, sz)

/*
 * io{read,write}{16,32}be() macros
 */
+0 −1
Original line number Diff line number Diff line
@@ -392,7 +392,6 @@ static inline void memcpy_toio(volatile void __iomem *to, const void *from,
 */
void __iomem *ioremap(resource_size_t res_cookie, size_t size);
#define ioremap ioremap
#define ioremap_nocache ioremap

/*
 * Do not use ioremap_cache for mapping memory. Use memremap instead.
+0 −2
Original line number Diff line number Diff line
@@ -167,9 +167,7 @@ extern void iounmap(volatile void __iomem *addr);
extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);

#define ioremap(addr, size)		__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
#define ioremap_nocache(addr, size)	__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
#define ioremap_wc(addr, size)		__ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
#define ioremap_wt(addr, size)		__ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))

/*
 * PCI configuration space mapping function.
+0 −1
Original line number Diff line number Diff line
@@ -42,7 +42,6 @@ extern void iounmap(void *addr);

#define ioremap(addr, size)		__ioremap((addr), (size), pgprot_noncached(PAGE_KERNEL))
#define ioremap_wc(addr, size)		__ioremap((addr), (size), pgprot_writecombine(PAGE_KERNEL))
#define ioremap_nocache(addr, size)	ioremap((addr), (size))
#define ioremap_cache			ioremap_cache

#include <asm-generic/io.h>
+0 −1
Original line number Diff line number Diff line
@@ -263,7 +263,6 @@ static inline void __iomem * ioremap_cache (unsigned long phys_addr, unsigned lo
	return ioremap(phys_addr, size);
}
#define ioremap ioremap
#define ioremap_nocache ioremap
#define ioremap_cache ioremap_cache
#define ioremap_uc ioremap_uc
#define iounmap iounmap
Loading