Commit 9555b47f authored by Ricardo Ribalda's avatar Ricardo Ribalda Committed by David S. Miller

sparc: io_64.h: Replace io function-link macros

Function like macros cannot be assigned to function pointers. This patch
convert the function-like macros into object-macros, that the
precompiler will replace with the name of the final function.

With this patch this kind of code will work:

if (priv->mode_big_endian)
	priv.read = ioread32be;
else
	priv.read = ioread32;

Same approach has been taken on asm-generic/io.h
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Fixes: 99082eab spi/xilinx: Remove iowrite/ioread wrappers
Signed-off-by: default avatarRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 94ab5990
...@@ -407,16 +407,16 @@ static inline void iounmap(volatile void __iomem *addr) ...@@ -407,16 +407,16 @@ static inline void iounmap(volatile void __iomem *addr)
{ {
} }
#define ioread8(X) readb(X) #define ioread8 readb
#define ioread16(X) readw(X) #define ioread16 readw
#define ioread16be(X) __raw_readw(X) #define ioread16be __raw_readw
#define ioread32(X) readl(X) #define ioread32 readl
#define ioread32be(X) __raw_readl(X) #define ioread32be __raw_readl
#define iowrite8(val,X) writeb(val,X) #define iowrite8 writeb
#define iowrite16(val,X) writew(val,X) #define iowrite16 writew
#define iowrite16be(val,X) __raw_writew(val,X) #define iowrite16be __raw_writew
#define iowrite32(val,X) writel(val,X) #define iowrite32 writel
#define iowrite32be(val,X) __raw_writel(val,X) #define iowrite32be __raw_writel
/* Create a virtual mapping cookie for an IO port range */ /* Create a virtual mapping cookie for an IO port range */
void __iomem *ioport_map(unsigned long port, unsigned int nr); void __iomem *ioport_map(unsigned long port, unsigned int nr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment