out_region2: release_region(card->ac97base, 256); 
static int __devinit i810_probe(struct pci_dev *pci_dev, const struct pci_device_id *pci_id){	struct i810_card *card;	if (pci_enable_device(pci_dev))		return -EIO;	if (pci_set_dma_mask(pci_dev, I810_DMA_MASK)) {		printk(KERN_ERR "i810_audio: architecture does not support"		       " 32bit PCI busmaster DMA\n");		return -ENODEV;	}		if ((card = kmalloc(sizeof(struct i810_card), GFP_KERNEL)) == NULL) {		printk(KERN_ERR "i810_audio: out of memory\n");		return -ENOMEM;	}	memset(card, 0, sizeof(*card));	card->initializing = 1;	card->pci_dev = pci_dev;	card->pci_id = pci_id->device;	card->ac97base = pci_resource_start (pci_dev, 0);	card->iobase = pci_resource_start (pci_dev, 1);	if (!(card->ac97base) || !(card->iobase)) {		card->ac97base = 0;		card->iobase = 0;	}	/* if chipset could have mmio capability, check it */ 	if (card_cap[pci_id->driver_data].flags & CAP_MMIO) {		card->ac97base_mmio_phys = pci_resource_start (pci_dev, 2);		card->iobase_mmio_phys = pci_resource_start (pci_dev, 3);		if ((card->ac97base_mmio_phys) && (card->iobase_mmio_phys)) {			card->use_mmio = 1;		}		else {			card->ac97base_mmio_phys = 0;			card->iobase_mmio_phys = 0;		}	}	if (!(card->use_mmio) && (!(card->iobase) || !(card->ac97base))) {		printk(KERN_ERR "i810_audio: No I/O resources available.\n");		goto out_mem;	}	card->irq = pci_dev->irq;	card->next = devs;	card->magic = I810_CARD_MAGIC;#ifdef CONFIG_PM	card->pm_suspended=0;#endif	spin_lock_init(&card->lock);	spin_lock_init(&card->ac97_lock);	devs = card;	pci_set_master(pci_dev);	printk(KERN_INFO "i810: %s found at IO 0x%04lx and 0x%04lx, "	       "MEM 0x%04lx and 0x%04lx, IRQ %d\n",	       card_names[pci_id->driver_data], 	       card->iobase, card->ac97base, 	       card->ac97base_mmio_phys, card->iobase_mmio_phys,	       card->irq);	card->alloc_pcm_channel = i810_alloc_pcm_channel;	card->alloc_rec_pcm_channel = i810_alloc_rec_pcm_channel;	card->alloc_rec_mic_channel = i810_alloc_rec_mic_channel;	card->free_pcm_channel = i810_free_pcm_channel;	if ((card->channel = pci_alloc_consistent(pci_dev,	    sizeof(struct i810_channel)*NR_HW_CH, &card->chandma)) == NULL) {		printk(KERN_ERR "i810: cannot allocate channel DMA memory\n");		goto out_mem;	}	{ /* We may dispose of this altogether some time soon, so... */		struct i810_channel *cp = card->channel;		cp[0].offset = 0;		cp[0].port = 0x00;		cp[0].num = 0;		cp[1].offset = 0;		cp[1].port = 0x10;		cp[1].num = 1;		cp[2].offset = 0;		cp[2].port = 0x20;		cp[2].num = 2;	}	/* claim our iospace and irq */	if (!request_region(card->iobase, 64, card_names[pci_id->driver_data])) {		printk(KERN_ERR "i810_audio: unable to allocate region %lx\n", card->iobase);		goto out_region1;	}	if (!request_region(card->ac97base, 256, card_names[pci_id->driver_data])) {		printk(KERN_ERR "i810_audio: unable to allocate region %lx\n", card->ac97base);		goto out_region2;	}	if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ,			card_names[pci_id->driver_data], card)) {		printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq);		goto out_pio;	}	if (card->use_mmio) {		if (request_mem_region(card->ac97base_mmio_phys, 512, "ich_audio MMBAR")) {			if ((card->ac97base_mmio = ioremap(card->ac97base_mmio_phys, 512))) { /*@FIXME can ioremap fail? don't know (jsaw) */				if (request_mem_region(card->iobase_mmio_phys, 256, "ich_audio MBBAR")) {					if ((card->iobase_mmio = ioremap(card->iobase_mmio_phys, 256))) {						printk(KERN_INFO "i810: %s mmio at 0x%04lx and 0x%04lx\n",						       card_names[pci_id->driver_data], 						       (unsigned long) card->ac97base_mmio, 						       (unsigned long) card->iobase_mmio); 					}					else {						iounmap(card->ac97base_mmio);						release_mem_region(card->ac97base_mmio_phys, 512);						release_mem_region(card->iobase_mmio_phys, 512);						card->use_mmio = 0;					}				}				else {					iounmap(card->ac97base_mmio);					release_mem_region(card->ac97base_mmio_phys, 512);					card->use_mmio = 0;				}			}		}		else {			card->use_mmio = 0;		}	}	/* initialize AC97 codec and register /dev/mixer */	if (i810_ac97_init(card) <= 0) {		free_irq(card->irq, card);		goto out_iospace;	}	pci_set_drvdata(pci_dev, card);	if(clocking == 0) {		clocking = 48000;		i810_configure_clocking();	}	/* register /dev/dsp */	if ((card->dev_audio = register_sound_dsp(&i810_audio_fops, -1)) < 0) {		int i;		printk(KERN_ERR "i810_audio: couldn't register DSP device!\n");		free_irq(card->irq, card);		for (i = 0; i < NR_AC97; i++)		if (card->ac97_codec[i] != NULL) {			unregister_sound_mixer(card->ac97_codec[i]->dev_mixer);			ac97_release_codec(card->ac97_codec[i]);		}		goto out_iospace;	} 	card->initializing = 0;	return 0;out_iospace:	if (card->use_mmio) {		iounmap(card->ac97base_mmio);		iounmap(card->iobase_mmio);		release_mem_region(card->ac97base_mmio_phys, 512);		release_mem_region(card->iobase_mmio_phys, 256);	}out_pio:		release_region(card->iobase, 64);out_region2:	release_region(card->ac97base, 256);out_region1:	pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH,	    card->channel, card->chandma);out_mem:	kfree(card);	return -ENODEV;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7087e295543d3f6e161530e07982fd979e2d9efc/i810_audio.c/buggy/sound/oss/i810_audio.c