#endif 
static int __devinit azx_create(snd_card_t *card, struct pci_dev *pci, azx_t **rchip){	azx_t *chip;	int err = 0;	static snd_device_ops_t ops = {		.dev_free = azx_dev_free,	};	*rchip = NULL;		if ((err = pci_enable_device(pci)) < 0)		return err;	chip = kcalloc(1, sizeof(*chip), GFP_KERNEL);		if (NULL == chip) {		snd_printk(KERN_ERR SFX "cannot allocate chip\n");		pci_disable_device(pci);		return -ENOMEM;	}	spin_lock_init(&chip->reg_lock);	init_MUTEX(&chip->open_mutex);	chip->card = card;	chip->pci = pci;	chip->irq = -1;	if ((err = pci_request_regions(pci, "ICH HD audio")) < 0) {		kfree(chip);		pci_disable_device(pci);		return err;	}	chip->addr = pci_resource_start(pci,0);	chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci,0));	if (chip->remap_addr == NULL) {		snd_printk(KERN_ERR SFX "ioremap error\n");		err = -ENXIO;		goto errout;	}	if (request_irq(pci->irq, azx_interrupt, SA_INTERRUPT|SA_SHIRQ,			"HDA Intel", (void*)chip)) {		snd_printk(KERN_ERR SFX "unable to grab IRQ %d\n", pci->irq);		err = -EBUSY;		goto errout;	}	chip->irq = pci->irq;	pci_set_master(pci);	synchronize_irq(chip->irq);	/* allocate memory for the BDL for each stream */	if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),				       PAGE_SIZE, &chip->bdl)) < 0) {		snd_printk(KERN_ERR SFX "cannot allocate BDL\n");		goto errout;	}#ifdef USE_POSBUF	/* allocate memory for the position buffer */	if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),				       MAX_ICH6_DEV * 8, &chip->posbuf)) < 0) {		snd_printk(KERN_ERR SFX "cannot allocate posbuf\n");		goto errout;	}#endif	/* allocate CORB/RIRB */	if ((err = azx_alloc_cmd_io(chip)) < 0)		goto errout;	/* initialize streams */	azx_init_stream(chip);	/* initialize chip */	azx_init_chip(chip);	/* codec detection */	if (! chip->codec_mask) {		snd_printk(KERN_ERR SFX "no codecs found!\n");		err = -ENODEV;		goto errout;	}	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) <0) {		snd_printk(KERN_ERR SFX "Error creating device [card]!\n");		goto errout;	}	*rchip = chip;	return 0; errout:	azx_free(chip);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c74db86bcf0897cdd4dc1f85ae0d76ef59aaeb20/hda_intel.c/clean/sound/pci/hda/hda_intel.c