[AVR32] Use memcpy/memset in memcpy_{from,to}_io and memset_io
authorHaavard Skinnemoen <hskinnemoen@atmel.com>
Wed, 7 Mar 2007 09:40:44 +0000 (10:40 +0100)
committerHaavard Skinnemoen <hskinnemoen@atmel.com>
Fri, 27 Apr 2007 11:44:15 +0000 (13:44 +0200)
Using readb/writeb to implement these breaks NOR flash support. I
can't see any reason why regular memcpy and memset shouldn't work.

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
include/asm-avr32/io.h

index 27b1523d42e05631848aae4d4ddbe80db8fe5c86..e30d4b3bd83610d40628e70345dc786f09e75c3a 100644 (file)
@@ -240,30 +240,19 @@ BUILDSTRING(l, u32)
 static inline void memcpy_fromio(void * to, const volatile void __iomem *from,
                                 unsigned long count)
 {
-       char *p = to;
-       volatile const char __iomem *addr = from;
-
-       while (count--)
-               *p++ = readb(addr++);
+       memcpy(to, (const void __force *)from, count);
 }
 
 static inline void  memcpy_toio(volatile void __iomem *to, const void * from,
                                unsigned long count)
 {
-       const char *p = from;
-       volatile char __iomem *addr = to;
-
-       while (count--)
-               writeb(*p++, addr++);
+       memcpy((void __force *)to, from, count);
 }
 
 static inline void memset_io(volatile void __iomem *addr, unsigned char val,
                             unsigned long count)
 {
-       volatile char __iomem *p = addr;
-
-       while (count--)
-               writeb(val, p++);
+       memset((void __force *)addr, val, count);
 }
 
 #define IO_SPACE_LIMIT 0xffffffff