Skip to content

Commit

Permalink
ARM: io: make iounmap() a simple macro
Browse files Browse the repository at this point in the history
Defining iounmap() with arguments prevents it from being used as a
function pointer, causing platforms to work around this.  Instead,
define it to be a simple macro.

Do the same for __arch_io(re|un)map too.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Dec 8, 2010
1 parent cf7d7e5 commit a0b7bd0
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions arch/arm/include/asm/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ extern void _memset_io(volatile void __iomem *, int, size_t);
#define ioremap_nocache(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE)
#define ioremap_cached(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_CACHED)
#define ioremap_wc(cookie,size) __arm_ioremap(cookie, size, MT_DEVICE_WC)
#define iounmap(cookie) __iounmap(cookie)
#define iounmap __iounmap
#else
#define ioremap(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE)
#define ioremap_nocache(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE)
#define ioremap_cached(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_CACHED)
#define ioremap_wc(cookie,size) __arch_ioremap((cookie), (size), MT_DEVICE_WC)
#define iounmap(cookie) __arch_iounmap(cookie)
#define iounmap __arch_iounmap
#endif

/*
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-davinci/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#define __mem_isa(a) (a)

#ifndef __ASSEMBLER__
#define __arch_ioremap(p, s, t) davinci_ioremap(p, s, t)
#define __arch_iounmap(v) davinci_iounmap(v)
#define __arch_ioremap davinci_ioremap
#define __arch_iounmap davinci_iounmap

void __iomem *davinci_ioremap(unsigned long phys, size_t size,
unsigned int type);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-iop13xx/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extern u32 iop13xx_atux_mem_base;
extern size_t iop13xx_atue_mem_size;
extern size_t iop13xx_atux_mem_size;

#define __arch_ioremap(a, s, f) __iop13xx_ioremap(a, s, f)
#define __arch_iounmap(a) __iop13xx_iounmap(a)
#define __arch_ioremap __iop13xx_ioremap
#define __arch_iounmap __iop13xx_iounmap

#endif
4 changes: 2 additions & 2 deletions arch/arm/mach-iop32x/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern void __iop3xx_iounmap(void __iomem *addr);
#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
#define __mem_pci(a) (a)

#define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f)
#define __arch_iounmap(a) __iop3xx_iounmap(a)
#define __arch_ioremap __iop3xx_ioremap
#define __arch_iounmap __iop3xx_iounmap

#endif
4 changes: 2 additions & 2 deletions arch/arm/mach-iop33x/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern void __iop3xx_iounmap(void __iomem *addr);
#define __io(p) ((void __iomem *)IOP3XX_PCI_IO_PHYS_TO_VIRT(p))
#define __mem_pci(a) (a)

#define __arch_ioremap(a, s, f) __iop3xx_ioremap(a, s, f)
#define __arch_iounmap(a) __iop3xx_iounmap(a)
#define __arch_ioremap __iop3xx_ioremap
#define __arch_iounmap __iop3xx_iounmap

#endif
4 changes: 2 additions & 2 deletions arch/arm/mach-ixp23xx/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ ixp23xx_iounmap(void __iomem *addr)
__iounmap(addr);
}

#define __arch_ioremap(a,s,f) ixp23xx_ioremap(a,s,f)
#define __arch_iounmap(a) ixp23xx_iounmap(a)
#define __arch_ioremap ixp23xx_ioremap
#define __arch_iounmap ixp23xx_iounmap


#endif
4 changes: 2 additions & 2 deletions arch/arm/mach-ixp4xx/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ static inline void __indirect_iounmap(void __iomem *addr)
__iounmap(addr);
}

#define __arch_ioremap(a, s, f) __indirect_ioremap(a, s, f)
#define __arch_iounmap(a) __indirect_iounmap(a)
#define __arch_ioremap __indirect_ioremap
#define __arch_iounmap __indirect_iounmap

#define writeb(v, p) __indirect_writeb(v, p)
#define writew(v, p) __indirect_writew(v, p)
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-kirkwood/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ __arch_iounmap(void __iomem *addr)
__iounmap(addr);
}

#define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m)
#define __arch_iounmap(a) __arch_iounmap(a)
#define __arch_ioremap __arch_ioremap
#define __arch_iounmap __arch_iounmap
#define __io(a) __io(a)
#define __mem_pci(a) (a)

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-orion5x/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ __arch_iounmap(void __iomem *addr)
__iounmap(addr);
}

#define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m)
#define __arch_iounmap(a) __arch_iounmap(a)
#define __arch_ioremap __arch_ioremap
#define __arch_iounmap __arch_iounmap
#define __io(a) __typesafe_io(a)
#define __mem_pci(a) (a)

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-tegra/include/mach/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@

#ifndef __ASSEMBLER__

#define __arch_ioremap(p, s, t) tegra_ioremap(p, s, t)
#define __arch_iounmap(v) tegra_iounmap(v)
#define __arch_ioremap tegra_ioremap
#define __arch_iounmap tegra_iounmap

void __iomem *tegra_ioremap(unsigned long phys, size_t size, unsigned int type);
void tegra_iounmap(volatile void __iomem *addr);
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/plat-omap/include/plat/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ static inline void omap44xx_map_common_io(void)
extern void omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
struct omap_sdrc_params *sdrc_cs1);

#define __arch_ioremap(p,s,t) omap_ioremap(p,s,t)
#define __arch_iounmap(v) omap_iounmap(v)
#define __arch_ioremap omap_ioremap
#define __arch_iounmap omap_iounmap

void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
void omap_iounmap(volatile void __iomem *addr);
Expand Down

0 comments on commit a0b7bd0

Please sign in to comment.