Skip to content

Commit 0305292

Browse files
mpemaddy-kerneldev
authored andcommitted
powerpc/io: Use generic raw accessors
The raw accessors are identical to the generic versions, use the generic versions. Suggested-by: Arnd Bergmann <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent c051451 commit 0305292

File tree

1 file changed

+9
-59
lines changed
  • arch/powerpc/include/asm

1 file changed

+9
-59
lines changed

arch/powerpc/include/asm/io.h

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -276,67 +276,9 @@ extern void _memcpy_toio(volatile void __iomem *dest, const void *src,
276276

277277
#define _IO_PORT(port) ((volatile void __iomem *)(_IO_BASE + (port)))
278278

279-
/*
280-
* Non ordered and non-swapping "raw" accessors
281-
*/
282-
283-
static inline unsigned char __raw_readb(const volatile void __iomem *addr)
284-
{
285-
return *(volatile unsigned char __force *)addr;
286-
}
287-
#define __raw_readb __raw_readb
288-
289-
static inline unsigned short __raw_readw(const volatile void __iomem *addr)
290-
{
291-
return *(volatile unsigned short __force *)addr;
292-
}
293-
#define __raw_readw __raw_readw
294-
295-
static inline unsigned int __raw_readl(const volatile void __iomem *addr)
296-
{
297-
return *(volatile unsigned int __force *)addr;
298-
}
299-
#define __raw_readl __raw_readl
300-
301-
static inline void __raw_writeb(unsigned char v, volatile void __iomem *addr)
302-
{
303-
*(volatile unsigned char __force *)addr = v;
304-
}
305-
#define __raw_writeb __raw_writeb
306-
307-
static inline void __raw_writew(unsigned short v, volatile void __iomem *addr)
308-
{
309-
*(volatile unsigned short __force *)addr = v;
310-
}
311-
#define __raw_writew __raw_writew
312-
313-
static inline void __raw_writel(unsigned int v, volatile void __iomem *addr)
314-
{
315-
*(volatile unsigned int __force *)addr = v;
316-
}
317-
#define __raw_writel __raw_writel
318-
319279
#ifdef __powerpc64__
320-
static inline unsigned long __raw_readq(const volatile void __iomem *addr)
321-
{
322-
return *(volatile unsigned long __force *)addr;
323-
}
324-
#define __raw_readq __raw_readq
325-
326-
static inline void __raw_writeq(unsigned long v, volatile void __iomem *addr)
327-
{
328-
*(volatile unsigned long __force *)addr = v;
329-
}
330-
#define __raw_writeq __raw_writeq
331-
332-
static inline void __raw_writeq_be(unsigned long v, volatile void __iomem *addr)
333-
{
334-
__raw_writeq((__force unsigned long)cpu_to_be64(v), addr);
335-
}
336-
#define __raw_writeq_be __raw_writeq_be
337-
338280
/*
339-
* Real mode versions of the above. Those instructions are only supposed
281+
* Real mode versions of raw accessors. Those instructions are only supposed
340282
* to be used in hypervisor real mode as per the architecture spec.
341283
*/
342284
static inline void __raw_rm_writeb(u8 val, volatile void __iomem *paddr)
@@ -1080,6 +1022,14 @@ static inline void * bus_to_virt(unsigned long address)
10801022

10811023
#include <asm-generic/io.h>
10821024

1025+
#ifdef __powerpc64__
1026+
static inline void __raw_writeq_be(unsigned long v, volatile void __iomem *addr)
1027+
{
1028+
__raw_writeq((__force unsigned long)cpu_to_be64(v), addr);
1029+
}
1030+
#define __raw_writeq_be __raw_writeq_be
1031+
#endif // __powerpc64__
1032+
10831033
#endif /* __KERNEL__ */
10841034

10851035
#endif /* _ASM_POWERPC_IO_H */

0 commit comments

Comments
 (0)