out2: #ifdef jumpered_dma free_dma(dev->dma); #endif 
static int __init netcard_probe1(struct net_device *dev, int ioaddr){	struct net_local *np;	static unsigned version_printed;	int i;	int err = -ENODEV;	/* Grab the region so that no one else tries to probe our ioports. */	if (!request_region(ioaddr, NETCARD_IO_EXTENT, cardname))		return -EBUSY;	/*	 * For ethernet adaptors the first three octets of the station address 	 * contains the manufacturer's unique code. That might be a good probe	 * method. Ideally you would add additional checks.	 */ 	if (inb(ioaddr + 0) != SA_ADDR0		||	 inb(ioaddr + 1) != SA_ADDR1		||	 inb(ioaddr + 2) != SA_ADDR2)		goto out;	if (net_debug  &&  version_printed++ == 0)		printk(KERN_DEBUG "%s", version);	printk(KERN_INFO "%s: %s found at %#3x, ", dev->name, cardname, ioaddr);	/* Fill in the 'dev' fields. */	dev->base_addr = ioaddr;	/* Retrieve and print the ethernet address. */	for (i = 0; i < 6; i++)		printk(" %2.2x", dev->dev_addr[i] = inb(ioaddr + i));	err = -EAGAIN;#ifdef jumpered_interrupts	/*	 * If this board has jumpered interrupts, allocate the interrupt	 * vector now. There is no point in waiting since no other device	 * can use the interrupt, and this marks the irq as busy. Jumpered	 * interrupts are typically not reported by the boards, and we must	 * used autoIRQ to find them.	 */	if (dev->irq == -1)		;	/* Do nothing: a user-level program will set it. */	else if (dev->irq < 2) {	/* "Auto-IRQ" */		unsigned long irq_mask = probe_irq_on();		/* Trigger an interrupt here. */		dev->irq = probe_irq_off(irq_mask);		if (net_debug >= 2)			printk(" autoirq is %d", dev->irq);	} else if (dev->irq == 2)		/*		 * Fixup for users that don't know that IRQ 2 is really		 * IRQ9, or don't know which one to set.		 */		dev->irq = 9;	{		int irqval = request_irq(dev->irq, &net_interrupt, 0, cardname, dev);		if (irqval) {			printk("%s: unable to get IRQ %d (irqval=%d).\n",				   dev->name, dev->irq, irqval);			goto out;		}	}#endif	/* jumpered interrupt */#ifdef jumpered_dma	/*	 * If we use a jumpered DMA channel, that should be probed for and	 * allocated here as well. See lance.c for an example.	 */	if (dev->dma == 0) {		if (request_dma(dev->dma, cardname)) {			printk("DMA %d allocation failed.\n", dev->dma);			goto out1;		} else			printk(", assigned DMA %d.\n", dev->dma);	} else {		short dma_status, new_dma_status;		/* Read the DMA channel status registers. */		dma_status = ((inb(DMA1_STAT_REG) >> 4) & 0x0f) |			(inb(DMA2_STAT_REG) & 0xf0);		/* Trigger a DMA request, perhaps pause a bit. */		outw(0x1234, ioaddr + 8);		/* Re-read the DMA status registers. */		new_dma_status = ((inb(DMA1_STAT_REG) >> 4) & 0x0f) |			(inb(DMA2_STAT_REG) & 0xf0);		/*		 * Eliminate the old and floating requests,		 * and DMA4 the cascade.		 */		new_dma_status ^= dma_status;		new_dma_status &= ~0x10;		for (i = 7; i > 0; i--)			if (test_bit(i, &new_dma_status)) {				dev->dma = i;				break;			}		if (i <= 0) {			printk("DMA probe failed.\n");			goto out1;		} 		if (request_dma(dev->dma, cardname)) {			printk("probed DMA %d allocation failed.\n", dev->dma);			goto out1;		}	}#endif	/* jumpered DMA */	np = netdev_priv(dev);	spin_lock_init(&np->lock);	dev->open		= net_open;	dev->stop		= net_close;	dev->hard_start_xmit	= net_send_packet;	dev->get_stats		= net_get_stats;	dev->set_multicast_list = &set_multicast_list;        dev->tx_timeout		= &net_tx_timeout;        dev->watchdog_timeo	= MY_TX_TIMEOUT; 	return 0;out1:#ifdef jumpered_interrupts	free_irq(dev->irq, dev);#endifout:	release_region(base_addr, NETCARD_IO_EXTENT);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b1fc5505e0dbcc3fd7c75bfe6bee39ec50080963/isa-skeleton.c/buggy/drivers/net/isa-skeleton.c