iounmap((void *)dev->mem_start); 
iounmap(ei_status.mem); 
static int __init lne390_probe1(struct net_device *dev, int ioaddr){	int i, revision, ret;	unsigned long eisa_id;	if (inb_p(ioaddr + LNE390_ID_PORT) == 0xff) return -ENODEV;#if LNE390_DEBUG & LNE390_D_PROBE	printk("lne390-debug: probe at %#x, ID %#8x\n", ioaddr, inl(ioaddr + LNE390_ID_PORT));	printk("lne390-debug: config regs: %#x %#x\n",		inb(ioaddr + LNE390_CFG1), inb(ioaddr + LNE390_CFG2));#endif/*	Check the EISA ID of the card. */	eisa_id = inl(ioaddr + LNE390_ID_PORT);	if ((eisa_id != LNE390_ID0) && (eisa_id != LNE390_ID1)) {		return -ENODEV;	}	revision = (eisa_id >> 24) & 0x01;	/* 0 = rev A, 1 rev B */	#if 0/*	Check the Mylex vendor ID as well. Not really required. */	if (inb(ioaddr + LNE390_SA_PROM + 0) != LNE390_ADDR0		|| inb(ioaddr + LNE390_SA_PROM + 1) != LNE390_ADDR1		|| inb(ioaddr + LNE390_SA_PROM + 2) != LNE390_ADDR2 ) {		printk("lne390.c: card not found");		for(i = 0; i < ETHER_ADDR_LEN; i++)			printk(" %02x", inb(ioaddr + LNE390_SA_PROM + i));		printk(" (invalid prefix).\n");		return -ENODEV;	}#endif	printk("lne390.c: LNE390%X in EISA slot %d, address", 0xa+revision, ioaddr/0x1000);	for(i = 0; i < ETHER_ADDR_LEN; i++)		printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i)));	printk(".\nlne390.c: ");	/* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */	if (dev->irq == 0) {		unsigned char irq_reg = inb(ioaddr + LNE390_CFG2) >> 3;		dev->irq = irq_map[irq_reg & 0x07];		printk("using");	} else {		/* This is useless unless we reprogram the card here too */		if (dev->irq == 2) dev->irq = 9;	/* Doh! */		printk("assigning");	}	printk(" IRQ %d,", dev->irq);	if ((ret = request_irq(dev->irq, ei_interrupt, 0, DRV_NAME, dev))) {		printk (" unable to get IRQ %d.\n", dev->irq);		return ret;	}	if (dev->mem_start == 0) {		unsigned char mem_reg = inb(ioaddr + LNE390_CFG2) & 0x07;		if (revision)	/* LNE390B */			dev->mem_start = shmem_mapB[mem_reg] * 0x10000;		else		/* LNE390A */			dev->mem_start = shmem_mapA[mem_reg] * 0x10000;		printk(" using ");	} else {		/* Should check for value in shmem_map and reprogram the card to use it */		dev->mem_start &= 0xfff0000;		printk(" assigning ");	}	printk("%dkB memory at physical address %#lx\n",			LNE390_STOP_PG/4, dev->mem_start);	/*	   BEWARE!! Some dain-bramaged EISA SCUs will allow you to put	   the card mem within the region covered by `normal' RAM  !!!	   ioremap() will fail in that case.	*/	ei_status.mem = ioremap(dev->mem_start, LNE390_STOP_PG*0x100);	if (!ei_status.mem) {		printk(KERN_ERR "lne390.c: Unable to remap card memory above 1MB !!\n");		printk(KERN_ERR "lne390.c: Try using EISA SCU to set memory below 1MB.\n");		printk(KERN_ERR "lne390.c: Driver NOT installed.\n");		ret = -EAGAIN;		goto cleanup;	}	printk("lne390.c: remapped %dkB card memory to virtual address %p\n",			LNE390_STOP_PG/4, ei_status.mem);	dev->mem_start = (unsigned long)ei_status.mem;	dev->mem_end = dev->mem_start + (LNE390_STOP_PG - LNE390_START_PG)*256;	/* The 8390 offset is zero for the LNE390 */	dev->base_addr = ioaddr;	ei_status.name = "LNE390";	ei_status.tx_start_page = LNE390_START_PG;	ei_status.rx_start_page = LNE390_START_PG + TX_PAGES;	ei_status.stop_page = LNE390_STOP_PG;	ei_status.word16 = 1;	if (ei_debug > 0)		printk(version);	ei_status.reset_8390 = &lne390_reset_8390;	ei_status.block_input = &lne390_block_input;	ei_status.block_output = &lne390_block_output;	ei_status.get_8390_hdr = &lne390_get_8390_hdr;	dev->open = &lne390_open;	dev->stop = &lne390_close;#ifdef CONFIG_NET_POLL_CONTROLLER	dev->poll_controller = ei_poll;#endif	NS8390_init(dev, 0);	ret = register_netdev(dev);	if (ret)		goto unmap;	return 0;unmap:	if (ei_status.reg0)		iounmap((void *)dev->mem_start);cleanup:	free_irq(dev->irq, dev);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/387d890db88b4eb7c1dd55a2a0c16d6f0dccc7ad/lne390.c/buggy/drivers/net/lne390.c