snd_printk("unable to grab IRQ %d\n", pci->irq); 
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq); 
snd_m3_create(snd_card_t *card, struct pci_dev *pci,	      int enable_amp,	      int amp_gpio,	      m3_t **chip_ret){	m3_t *chip;	int i, err;	struct m3_quirk *quirk;	struct m3_hv_quirk *hv_quirk;	static snd_device_ops_t ops = {		.dev_free =	snd_m3_dev_free,	};	*chip_ret = NULL;	if (pci_enable_device(pci))		return -EIO;	/* check, if we can restrict PCI DMA transfers to 28 bits */	if (pci_set_dma_mask(pci, 0x0fffffff) < 0 ||	    pci_set_consistent_dma_mask(pci, 0x0fffffff) < 0) {		snd_printk("architecture does not support 28bit PCI busmaster DMA\n");		pci_disable_device(pci);		return -ENXIO;	}	chip = kzalloc(sizeof(*chip), GFP_KERNEL);	if (chip == NULL) {		pci_disable_device(pci);		return -ENOMEM;	}	spin_lock_init(&chip->reg_lock);	spin_lock_init(&chip->ac97_lock);	switch (pci->device) {	case PCI_DEVICE_ID_ESS_ALLEGRO:	case PCI_DEVICE_ID_ESS_ALLEGRO_1:	case PCI_DEVICE_ID_ESS_CANYON3D_2LE:	case PCI_DEVICE_ID_ESS_CANYON3D_2:		chip->allegro_flag = 1;		break;	}	chip->card = card;	chip->pci = pci;	chip->irq = -1;	for (quirk = m3_quirk_list; quirk->vendor; quirk++) {		if (pci->subsystem_vendor == quirk->vendor &&		    pci->subsystem_device == quirk->device) {			printk(KERN_INFO "maestro3: enabled hack for '%s'\n", quirk->name);			chip->quirk = quirk;			break;		}	}	for (hv_quirk = m3_hv_quirk_list; hv_quirk->vendor; hv_quirk++) {		if (pci->vendor == hv_quirk->vendor &&		    pci->device == hv_quirk->device &&		    pci->subsystem_vendor == hv_quirk->subsystem_vendor &&		    pci->subsystem_device == hv_quirk->subsystem_device) {			chip->hv_quirk = hv_quirk;			break;		}	}	chip->external_amp = enable_amp;	if (amp_gpio >= 0 && amp_gpio <= 0x0f)		chip->amp_gpio = amp_gpio;	else if (chip->quirk && chip->quirk->amp_gpio >= 0)		chip->amp_gpio = chip->quirk->amp_gpio;	else if (chip->allegro_flag)		chip->amp_gpio = GPO_EXT_AMP_ALLEGRO;	else /* presumably this is for all 'maestro3's.. */		chip->amp_gpio = GPO_EXT_AMP_M3;	chip->num_substreams = NR_DSPS;	chip->substreams = kmalloc(sizeof(m3_dma_t) * chip->num_substreams, GFP_KERNEL);	if (chip->substreams == NULL) {		kfree(chip);		pci_disable_device(pci);		return -ENOMEM;	}	memset(chip->substreams, 0, sizeof(m3_dma_t) * chip->num_substreams);	if ((err = pci_request_regions(pci, card->driver)) < 0) {		snd_m3_free(chip);		return err;	}	chip->iobase = pci_resource_start(pci, 0);		/* just to be sure */	pci_set_master(pci);	snd_m3_chip_init(chip);	snd_m3_assp_halt(chip);	snd_m3_ac97_reset(chip);	snd_m3_amp_enable(chip, 1);	tasklet_init(&chip->hwvol_tq, snd_m3_update_hw_volume, (unsigned long)chip);	if (request_irq(pci->irq, snd_m3_interrupt, SA_INTERRUPT|SA_SHIRQ,			card->driver, (void *)chip)) {		snd_printk("unable to grab IRQ %d\n", pci->irq);		snd_m3_free(chip);		return -ENOMEM;	}	chip->irq = pci->irq;#ifdef CONFIG_PM	chip->suspend_mem = vmalloc(sizeof(u16) * (REV_B_CODE_MEMORY_LENGTH + REV_B_DATA_MEMORY_LENGTH));	if (chip->suspend_mem == NULL)		snd_printk(KERN_WARNING "can't allocate apm buffer\n");	else		snd_card_set_pm_callback(card, m3_suspend, m3_resume, chip);#endif	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {		snd_m3_free(chip);		return err;	}	if ((err = snd_m3_mixer(chip)) < 0)		return err;	for (i = 0; i < chip->num_substreams; i++) {		m3_dma_t *s = &chip->substreams[i];		s->chip = chip;		if ((err = snd_m3_assp_client_init(chip, s, i)) < 0)			return err;	}	if ((err = snd_m3_pcm(chip, 0)) < 0)		return err;    	snd_m3_enable_ints(chip);	snd_m3_assp_continue(chip);	snd_card_set_dev(card, &pci->dev);	*chip_ret = chip;	return 0; }
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/maestro3.c/clean/sound/pci/maestro3.c