Commit 4042cd75 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

net: mac8390: Use standard memcpy_{from,to}io()

The mac8390 driver defines its own variants of memcpy_fromio() and
memcpy_toio(), using similar implementations, but different function
signatures.

Remove the custom definitions of memcpy_fromio() and memcpy_toio(), and
adjust all callers to the standard signatures.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Acked-by: default avatarGreg Ungerer <gerg@linux-m68k.org>
parent e295066f
...@@ -153,9 +153,6 @@ static void dayna_block_input(struct net_device *dev, int count, ...@@ -153,9 +153,6 @@ static void dayna_block_input(struct net_device *dev, int count,
static void dayna_block_output(struct net_device *dev, int count, static void dayna_block_output(struct net_device *dev, int count,
const unsigned char *buf, int start_page); const unsigned char *buf, int start_page);
#define memcpy_fromio(a, b, c) memcpy((a), (void *)(b), (c))
#define memcpy_toio(a, b, c) memcpy((void *)(a), (b), (c))
#define memcmp_withio(a, b, c) memcmp((a), (void *)(b), (c)) #define memcmp_withio(a, b, c) memcmp((a), (void *)(b), (c))
/* Slow Sane (16-bit chunk memory read/write) Cabletron uses this */ /* Slow Sane (16-bit chunk memory read/write) Cabletron uses this */
...@@ -239,7 +236,7 @@ static enum mac8390_access mac8390_testio(unsigned long membase) ...@@ -239,7 +236,7 @@ static enum mac8390_access mac8390_testio(unsigned long membase)
unsigned long outdata = 0xA5A0B5B0; unsigned long outdata = 0xA5A0B5B0;
unsigned long indata = 0x00000000; unsigned long indata = 0x00000000;
/* Try writing 32 bits */ /* Try writing 32 bits */
memcpy_toio(membase, &outdata, 4); memcpy_toio((void __iomem *)membase, &outdata, 4);
/* Now compare them */ /* Now compare them */
if (memcmp_withio(&outdata, membase, 4) == 0) if (memcmp_withio(&outdata, membase, 4) == 0)
return ACCESS_32; return ACCESS_32;
...@@ -711,7 +708,7 @@ static void sane_get_8390_hdr(struct net_device *dev, ...@@ -711,7 +708,7 @@ static void sane_get_8390_hdr(struct net_device *dev,
struct e8390_pkt_hdr *hdr, int ring_page) struct e8390_pkt_hdr *hdr, int ring_page)
{ {
unsigned long hdr_start = (ring_page - WD_START_PG)<<8; unsigned long hdr_start = (ring_page - WD_START_PG)<<8;
memcpy_fromio(hdr, dev->mem_start + hdr_start, 4); memcpy_fromio(hdr, (void __iomem *)dev->mem_start + hdr_start, 4);
/* Fix endianness */ /* Fix endianness */
hdr->count = swab16(hdr->count); hdr->count = swab16(hdr->count);
} }
...@@ -725,13 +722,16 @@ static void sane_block_input(struct net_device *dev, int count, ...@@ -725,13 +722,16 @@ static void sane_block_input(struct net_device *dev, int count,
if (xfer_start + count > ei_status.rmem_end) { if (xfer_start + count > ei_status.rmem_end) {
/* We must wrap the input move. */ /* We must wrap the input move. */
int semi_count = ei_status.rmem_end - xfer_start; int semi_count = ei_status.rmem_end - xfer_start;
memcpy_fromio(skb->data, dev->mem_start + xfer_base, memcpy_fromio(skb->data,
(void __iomem *)dev->mem_start + xfer_base,
semi_count); semi_count);
count -= semi_count; count -= semi_count;
memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, memcpy_fromio(skb->data + semi_count,
count); (void __iomem *)ei_status.rmem_start, count);
} else { } else {
memcpy_fromio(skb->data, dev->mem_start + xfer_base, count); memcpy_fromio(skb->data,
(void __iomem *)dev->mem_start + xfer_base,
count);
} }
} }
...@@ -740,7 +740,7 @@ static void sane_block_output(struct net_device *dev, int count, ...@@ -740,7 +740,7 @@ static void sane_block_output(struct net_device *dev, int count,
{ {
long shmem = (start_page - WD_START_PG)<<8; long shmem = (start_page - WD_START_PG)<<8;
memcpy_toio(dev->mem_start + shmem, buf, count); memcpy_toio((void __iomem *)dev->mem_start + shmem, buf, count);
} }
/* dayna block input/output */ /* dayna block input/output */
......
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