Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch/*/io.h: remove ioremap_uc in some architectures

ioremap_uc() is only meaningful on old x86-32 systems with the PAT
extension, and on ia64 with its slightly unconventional ioremap()
behavior. So remove the ioremap_uc() definition in architecutures
other than x86 and ia64. These architectures all have asm-generic/io.h
included and will have the default ioremap_uc() definition which
returns NULL.

This changes the existing behaviour, while no need to worry about
any breakage because in the only callsite of ioremap_uc(), code
has been adjusted to eliminate the impact. Please see
atyfb_setup_generic() of drivers/video/fbdev/aty/atyfb_base.c.

If any new invocation of ioremap_uc() need be added, please consider
using ioremap() intead or adding a ARCH specific version if necessary.

Signed-off-by: Baoquan He <bhe@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Acked-by: Helge Deller <deller@gmx.de> # parisc
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> (SuperH)
Cc: linux-alpha@vger.kernel.org
Cc: linux-hexagon@vger.kernel.org
Cc: linux-m68k@lists.linux-m68k.org
Cc: linux-mips@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-sh@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

authored by

Baoquan He and committed by
Arnd Bergmann
026246f1 4bfb53e7

+5 -16
+5 -4
Documentation/driver-api/device-io.rst
··· 408 408 ioremap_uc() 409 409 ------------ 410 410 411 - ioremap_uc() behaves like ioremap() except that on the x86 architecture without 412 - 'PAT' mode, it marks memory as uncached even when the MTRR has designated 413 - it as cacheable, see Documentation/arch/x86/pat.rst. 411 + ioremap_uc() is only meaningful on old x86-32 systems with the PAT extension, 412 + and on ia64 with its slightly unconventional ioremap() behavior, everywhere 413 + elss ioremap_uc() defaults to return NULL. 414 414 415 - Portable drivers should avoid the use of ioremap_uc(). 415 + 416 + Portable drivers should avoid the use of ioremap_uc(), use ioremap() instead. 416 417 417 418 ioremap_cache() 418 419 ---------------
-1
arch/alpha/include/asm/io.h
··· 308 308 } 309 309 310 310 #define ioremap_wc ioremap 311 - #define ioremap_uc ioremap 312 311 313 312 static inline void iounmap(volatile void __iomem *addr) 314 313 {
-3
arch/hexagon/include/asm/io.h
··· 174 174 #define _PAGE_IOREMAP (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ 175 175 (__HEXAGON_C_DEV << 6)) 176 176 177 - #define ioremap_uc(addr, size) ioremap((addr), (size)) 178 - 179 - 180 177 #define __raw_writel writel 181 178 182 179 static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,
-1
arch/m68k/include/asm/kmap.h
··· 25 25 return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); 26 26 } 27 27 28 - #define ioremap_uc ioremap 29 28 #define ioremap_wt ioremap_wt 30 29 static inline void __iomem *ioremap_wt(unsigned long physaddr, 31 30 unsigned long size)
-1
arch/mips/include/asm/io.h
··· 170 170 */ 171 171 #define ioremap(offset, size) \ 172 172 ioremap_prot((offset), (size), _CACHE_UNCACHED) 173 - #define ioremap_uc ioremap 174 173 175 174 /* 176 175 * ioremap_cache - map bus memory into CPU space
-2
arch/parisc/include/asm/io.h
··· 132 132 133 133 #define ioremap_wc(addr, size) \ 134 134 ioremap_prot((addr), (size), _PAGE_IOREMAP) 135 - #define ioremap_uc(addr, size) \ 136 - ioremap_prot((addr), (size), _PAGE_IOREMAP) 137 135 138 136 #define pci_iounmap pci_iounmap 139 137
-1
arch/powerpc/include/asm/io.h
··· 900 900 #endif 901 901 902 902 void __iomem *ioremap_coherent(phys_addr_t address, unsigned long size); 903 - #define ioremap_uc(addr, size) ioremap((addr), (size)) 904 903 #define ioremap_cache(addr, size) \ 905 904 ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL)) 906 905
-2
arch/sh/include/asm/io.h
··· 302 302 ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL)) 303 303 #endif /* CONFIG_MMU */ 304 304 305 - #define ioremap_uc ioremap 306 - 307 305 /* 308 306 * Convert a physical pointer to a virtual kernel pointer for /dev/mem 309 307 * access
-1
arch/sparc/include/asm/io_64.h
··· 423 423 return (void __iomem *)offset; 424 424 } 425 425 426 - #define ioremap_uc(X,Y) ioremap((X),(Y)) 427 426 #define ioremap_wc(X,Y) ioremap((X),(Y)) 428 427 #define ioremap_wt(X,Y) ioremap((X),(Y)) 429 428 static inline void __iomem *ioremap_np(unsigned long offset, unsigned long size)