Skip to content

Commit 026246f

Browse files
Baoquan Hearndb
authored andcommitted
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>
1 parent 4bfb53e commit 026246f

9 files changed

Lines changed: 5 additions & 16 deletions

File tree

Documentation/driver-api/device-io.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,11 +408,12 @@ functions for details on the CPU side of things.
408408
ioremap_uc()
409409
------------
410410

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.
414414

415-
Portable drivers should avoid the use of ioremap_uc().
415+
416+
Portable drivers should avoid the use of ioremap_uc(), use ioremap() instead.
416417

417418
ioremap_cache()
418419
---------------

arch/alpha/include/asm/io.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,6 @@ static inline void __iomem *ioremap(unsigned long port, unsigned long size)
308308
}
309309

310310
#define ioremap_wc ioremap
311-
#define ioremap_uc ioremap
312311

313312
static inline void iounmap(volatile void __iomem *addr)
314313
{

arch/hexagon/include/asm/io.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ static inline void writel(u32 data, volatile void __iomem *addr)
174174
#define _PAGE_IOREMAP (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \
175175
(__HEXAGON_C_DEV << 6))
176176

177-
#define ioremap_uc(addr, size) ioremap((addr), (size))
178-
179-
180177
#define __raw_writel writel
181178

182179
static inline void memcpy_fromio(void *dst, const volatile void __iomem *src,

arch/m68k/include/asm/kmap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size)
2525
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
2626
}
2727

28-
#define ioremap_uc ioremap
2928
#define ioremap_wt ioremap_wt
3029
static inline void __iomem *ioremap_wt(unsigned long physaddr,
3130
unsigned long size)

arch/mips/include/asm/io.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ void iounmap(const volatile void __iomem *addr);
170170
*/
171171
#define ioremap(offset, size) \
172172
ioremap_prot((offset), (size), _CACHE_UNCACHED)
173-
#define ioremap_uc ioremap
174173

175174
/*
176175
* ioremap_cache - map bus memory into CPU space

arch/parisc/include/asm/io.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr)
132132

133133
#define ioremap_wc(addr, size) \
134134
ioremap_prot((addr), (size), _PAGE_IOREMAP)
135-
#define ioremap_uc(addr, size) \
136-
ioremap_prot((addr), (size), _PAGE_IOREMAP)
137135

138136
#define pci_iounmap pci_iounmap
139137

arch/powerpc/include/asm/io.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,6 @@ void __iomem *ioremap_wt(phys_addr_t address, unsigned long size);
900900
#endif
901901

902902
void __iomem *ioremap_coherent(phys_addr_t address, unsigned long size);
903-
#define ioremap_uc(addr, size) ioremap((addr), (size))
904903
#define ioremap_cache(addr, size) \
905904
ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL))
906905

arch/sh/include/asm/io.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ unsigned long long poke_real_address_q(unsigned long long addr,
302302
ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL))
303303
#endif /* CONFIG_MMU */
304304

305-
#define ioremap_uc ioremap
306-
307305
/*
308306
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
309307
* access

arch/sparc/include/asm/io_64.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size)
423423
return (void __iomem *)offset;
424424
}
425425

426-
#define ioremap_uc(X,Y) ioremap((X),(Y))
427426
#define ioremap_wc(X,Y) ioremap((X),(Y))
428427
#define ioremap_wt(X,Y) ioremap((X),(Y))
429428
static inline void __iomem *ioremap_np(unsigned long offset, unsigned long size)

0 commit comments

Comments
 (0)