aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hp-plus.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-03-24 06:15:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:19 -0500
commitb336cea307839f97684d314071ef683821c571ed (patch)
tree855b05000ff04ec4ab95663aaba19b61ed8cb628 /drivers/net/hp-plus.c
parent22bc685f4b93f4a0ce28e5829eaf754cb4f7c040 (diff)
[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: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/hp-plus.c')
-rw-r--r--drivers/net/hp-plus.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c
index 74e167e7dea7..0d7a6250e346 100644
--- a/drivers/net/hp-plus.c
+++ b/drivers/net/hp-plus.c
@@ -250,6 +250,12 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
250 ei_status.block_output = &hpp_mem_block_output; 250 ei_status.block_output = &hpp_mem_block_output;
251 ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr; 251 ei_status.get_8390_hdr = &hpp_mem_get_8390_hdr;
252 dev->mem_start = mem_start; 252 dev->mem_start = mem_start;
253 ei_status.mem = ioremap(mem_start,
254 (HP_STOP_PG - HP_START_PG)*256);
255 if (!ei_status.mem) {
256 retval = -ENOMEM;
257 goto out;
258 }
253 ei_status.rmem_start = dev->mem_start + TX_PAGES/2*256; 259 ei_status.rmem_start = dev->mem_start + TX_PAGES/2*256;
254 dev->mem_end = ei_status.rmem_end 260 dev->mem_end = ei_status.rmem_end
255 = dev->mem_start + (HP_STOP_PG - HP_START_PG)*256; 261 = 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 268
263 retval = register_netdev(dev); 269 retval = register_netdev(dev);
264 if (retval) 270 if (retval)
265 goto out; 271 goto out1;
266 return 0; 272 return 0;
273out1:
274 iounmap(ei_status.mem);
267out: 275out:
268 release_region(ioaddr, HP_IO_EXTENT); 276 release_region(ioaddr, HP_IO_EXTENT);
269 return retval; 277 return retval;
@@ -372,7 +380,7 @@ hpp_mem_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring
372 380
373 outw((ring_page<<8), ioaddr + HPP_IN_ADDR); 381 outw((ring_page<<8), ioaddr + HPP_IN_ADDR);
374 outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION); 382 outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION);
375 isa_memcpy_fromio(hdr, dev->mem_start, sizeof(struct e8390_pkt_hdr)); 383 memcpy_fromio(hdr, ei_status.mem, sizeof(struct e8390_pkt_hdr));
376 outw(option_reg, ioaddr + HPP_OPTION); 384 outw(option_reg, ioaddr + HPP_OPTION);
377 hdr->count = (le16_to_cpu(hdr->count) + 3) & ~3; /* Round up allocation. */ 385 hdr->count = (le16_to_cpu(hdr->count) + 3) & ~3; /* Round up allocation. */
378} 386}
@@ -391,7 +399,7 @@ hpp_mem_block_input(struct net_device *dev, int count, struct sk_buff *skb, int
391 Also note that we *can't* use eth_io_copy_and_sum() because 399 Also note that we *can't* use eth_io_copy_and_sum() because
392 it will not always copy "count" bytes (e.g. padded IP). */ 400 it will not always copy "count" bytes (e.g. padded IP). */
393 401
394 isa_memcpy_fromio(skb->data, dev->mem_start, count); 402 memcpy_fromio(skb->data, ei_status.mem, count);
395 outw(option_reg, ioaddr + HPP_OPTION); 403 outw(option_reg, ioaddr + HPP_OPTION);
396} 404}
397 405
@@ -416,7 +424,7 @@ hpp_mem_block_output(struct net_device *dev, int count,
416 424
417 outw(start_page << 8, ioaddr + HPP_OUT_ADDR); 425 outw(start_page << 8, ioaddr + HPP_OUT_ADDR);
418 outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION); 426 outw(option_reg & ~(MemDisable + BootROMEnb), ioaddr + HPP_OPTION);
419 isa_memcpy_toio(dev->mem_start, buf, (count + 3) & ~3); 427 memcpy_toio(ei_status.mem, buf, (count + 3) & ~3);
420 outw(option_reg, ioaddr + HPP_OPTION); 428 outw(option_reg, ioaddr + HPP_OPTION);
421 429
422 return; 430 return;
@@ -470,6 +478,7 @@ init_module(void)
470static void cleanup_card(struct net_device *dev) 478static void cleanup_card(struct net_device *dev)
471{ 479{
472 /* NB: hpp_close() handles free_irq */ 480 /* NB: hpp_close() handles free_irq */
481 iounmap(ei_status.mem);
473 release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT); 482 release_region(dev->base_addr - NIC_OFFSET, HP_IO_EXTENT);
474} 483}
475 484