Commit b336cea3 authored by Al Viro's avatar Al Viro Committed by Linus Torvalds

[PATCH] remove ISA legacy functions: drivers/net/hp-plus.c

switch to ioremap()

Adrian Bunk:
The order of the hunks in the patch was slightly rearranged due to an
unrelated change in the driver.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 22bc685f
...@@ -250,6 +250,12 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr) ...@@ -250,6 +250,12 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
ei_status.block_output = &hpp_mem_block_output; ei_status.block_output = &hpp_mem_block_output;
ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr; ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr;
dev->mem_start = mem_start; dev->mem_start = mem_start;
ei_status.mem = ioremap(mem_start,
(HP_STOP_PG - HP_START_PG)*256);
if (!ei_status.mem) {
retval = -ENOMEM;
goto out;
}
ei_status.rmem_start = dev->mem_start + TX_PAGES/2*256; ei_status.rmem_start = dev->mem_start + TX_PAGES/2*256;
dev->mem_end = ei_status.rmem_end dev->mem_end = ei_status.rmem_end
= dev->mem_start + (HP_STOP_PG - HP_START_PG)*256; = dev->mem_start + (HP_STOP_PG - HP_START_PG)*256;
...@@ -262,8 +268,10 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr) ...@@ -262,8 +268,10 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
retval = register_netdev(dev); retval = register_netdev(dev);
if (retval) if (retval)
goto out; goto out1;
return 0; return 0;
out1:
iounmap(ei_status.mem);
out: out:
release_region(ioaddr, HP_IO_EXTENT); release_region(ioaddr, HP_IO_EXTENT);
return retval; return retval;
...@@ -372,7 +380,7 @@ hpp_mem_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring ...@@ -372,7 +380,7 @@ hpp_mem_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring
outw((ring_page<<8), ioaddr + HPP_IN_ADDR); outw((ring_page<<8), ioaddr + HPP_IN_ADDR);
outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION); outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION);
isa_memcpy_fromio(hdr, dev->mem_start, sizeof(struct e8390_pkt_hdr)); memcpy_fromio(hdr, ei_status.mem, sizeof(struct e8390_pkt_hdr));
outw(option_reg, ioaddr + HPP_OPTION); outw(option_reg, ioaddr + HPP_OPTION);
hdr->count = (le16_to_cpu(hdr->count) + 3) & ~3; /* Round up allocation. */ hdr->count = (le16_to_cpu(hdr->count) + 3) & ~3; /* Round up allocation. */
} }
...@@ -391,7 +399,7 @@ hpp_mem_block_input(struct net_device *dev, int count, struct sk_buff *skb, int ...@@ -391,7 +399,7 @@ hpp_mem_block_input(struct net_device *dev, int count, struct sk_buff *skb, int
Also note that we *can't* use eth_io_copy_and_sum() because Also note that we *can't* use eth_io_copy_and_sum() because
it will not always copy "count" bytes (e.g. padded IP). */ it will not always copy "count" bytes (e.g. padded IP). */
isa_memcpy_fromio(skb->data, dev->mem_start, count); memcpy_fromio(skb->data, ei_status.mem, count);
outw(option_reg, ioaddr + HPP_OPTION); outw(option_reg, ioaddr + HPP_OPTION);
} }
...@@ -416,7 +424,7 @@ hpp_mem_block_output(struct net_device *dev, int count, ...@@ -416,7 +424,7 @@ hpp_mem_block_output(struct net_device *dev, int count,
outw(start_page << 8, ioaddr + HPP_OUT_ADDR); outw(start_page << 8, ioaddr + HPP_OUT_ADDR);
outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION); outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION);
isa_memcpy_toio(dev->mem_start, buf, (count + 3) & ~3); memcpy_toio(ei_status.mem, buf, (count + 3) & ~3);
outw(option_reg, ioaddr + HPP_OPTION); outw(option_reg, ioaddr + HPP_OPTION);
return; return;
...@@ -470,6 +478,7 @@ init_module(void) ...@@ -470,6 +478,7 @@ init_module(void)
static void cleanup_card(struct net_device *dev) static void cleanup_card(struct net_device *dev)
{ {
/* NB: hpp_close() handles free_irq */ /* NB: hpp_close() handles free_irq */
iounmap(ei_status.mem);
release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
} }
......
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