Commit 2bf0a8f6 authored by Matthew Leach's avatar Matthew Leach Committed by Linus Torvalds

usb: musb: use io{read,write}*_rep accessors

The {read,write}s{b,w,l} operations are not defined by all architectures
and are being removed from the asm-generic/io.h interface.

This patch replaces the usage of these string functions in the musb
accessors with io{read,write}{8,16,32}_rep calls instead.
Signed-off-by: default avatarMatthew Leach <matthew@mattleach.net>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Ben Herrenschmidt <benh@kernel.crashing.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 56c82cdc
...@@ -251,7 +251,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) ...@@ -251,7 +251,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
/* best case is 32bit-aligned source address */ /* best case is 32bit-aligned source address */
if ((0x02 & (unsigned long) src) == 0) { if ((0x02 & (unsigned long) src) == 0) {
if (len >= 4) { if (len >= 4) {
writesl(fifo, src + index, len >> 2); iowrite32_rep(fifo, src + index, len >> 2);
index += len & ~0x03; index += len & ~0x03;
} }
if (len & 0x02) { if (len & 0x02) {
...@@ -260,7 +260,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) ...@@ -260,7 +260,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
} }
} else { } else {
if (len >= 2) { if (len >= 2) {
writesw(fifo, src + index, len >> 1); iowrite16_rep(fifo, src + index, len >> 1);
index += len & ~0x01; index += len & ~0x01;
} }
} }
...@@ -268,7 +268,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) ...@@ -268,7 +268,7 @@ void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src)
musb_writeb(fifo, 0, src[index]); musb_writeb(fifo, 0, src[index]);
} else { } else {
/* byte aligned */ /* byte aligned */
writesb(fifo, src, len); iowrite8_rep(fifo, src, len);
} }
} }
...@@ -294,7 +294,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) ...@@ -294,7 +294,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
/* best case is 32bit-aligned destination address */ /* best case is 32bit-aligned destination address */
if ((0x02 & (unsigned long) dst) == 0) { if ((0x02 & (unsigned long) dst) == 0) {
if (len >= 4) { if (len >= 4) {
readsl(fifo, dst, len >> 2); ioread32_rep(fifo, dst, len >> 2);
index = len & ~0x03; index = len & ~0x03;
} }
if (len & 0x02) { if (len & 0x02) {
...@@ -303,7 +303,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) ...@@ -303,7 +303,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
} }
} else { } else {
if (len >= 2) { if (len >= 2) {
readsw(fifo, dst, len >> 1); ioread16_rep(fifo, dst, len >> 1);
index = len & ~0x01; index = len & ~0x01;
} }
} }
...@@ -311,7 +311,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) ...@@ -311,7 +311,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
dst[index] = musb_readb(fifo, 0); dst[index] = musb_readb(fifo, 0);
} else { } else {
/* byte aligned */ /* byte aligned */
readsb(fifo, dst, len); ioread8_rep(fifo, dst, len);
} }
} }
#endif #endif
......
...@@ -37,27 +37,6 @@ ...@@ -37,27 +37,6 @@
#include <linux/io.h> #include <linux/io.h>
#if !defined(CONFIG_ARM) && !defined(CONFIG_SUPERH) \
&& !defined(CONFIG_AVR32) && !defined(CONFIG_PPC32) \
&& !defined(CONFIG_PPC64) && !defined(CONFIG_BLACKFIN) \
&& !defined(CONFIG_MIPS) && !defined(CONFIG_M68K) \
&& !defined(CONFIG_XTENSA)
static inline void readsl(const void __iomem *addr, void *buf, int len)
{ insl((unsigned long)addr, buf, len); }
static inline void readsw(const void __iomem *addr, void *buf, int len)
{ insw((unsigned long)addr, buf, len); }
static inline void readsb(const void __iomem *addr, void *buf, int len)
{ insb((unsigned long)addr, buf, len); }
static inline void writesl(const void __iomem *addr, const void *buf, int len)
{ outsl((unsigned long)addr, buf, len); }
static inline void writesw(const void __iomem *addr, const void *buf, int len)
{ outsw((unsigned long)addr, buf, len); }
static inline void writesb(const void __iomem *addr, const void *buf, int len)
{ outsb((unsigned long)addr, buf, len); }
#endif
#ifndef CONFIG_BLACKFIN #ifndef CONFIG_BLACKFIN
/* NOTE: these offsets are all in bytes */ /* NOTE: these offsets are all in bytes */
......
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