snd_printk("ali create: chip init error.\n"); 
snd_printk(KERN_ERR "ali create: chip init error.\n"); 
static int __devinit snd_ali_create(snd_card_t * card,				    struct pci_dev *pci,				    int pcm_streams,				    int spdif_support,				    ali_t ** r_ali){	ali_t *codec;	int i, err;	unsigned short cmdw = 0;	struct pci_dev *pci_dev = NULL;        static snd_device_ops_t ops = {		(snd_dev_free_t *)snd_ali_dev_free,		NULL,		NULL        };	*r_ali = NULL;	snd_ali_printk("creating ...\n");	/* enable PCI device */	if ((err = pci_enable_device(pci)) < 0)		return err;	/* check, if we can restrict PCI DMA transfers to 31 bits */	if (pci_set_dma_mask(pci, 0x7fffffff) < 0 ||	    pci_set_consistent_dma_mask(pci, 0x7fffffff) < 0) {		snd_printk("architecture does not support 31bit PCI busmaster DMA\n");		pci_disable_device(pci);		return -ENXIO;	}	if ((codec = kzalloc(sizeof(*codec), GFP_KERNEL)) == NULL) {		pci_disable_device(pci);		return -ENOMEM;	}	spin_lock_init(&codec->reg_lock);	spin_lock_init(&codec->voice_alloc);	codec->card = card;	codec->pci = pci;	codec->irq = -1;	pci_read_config_byte(pci, PCI_REVISION_ID, &codec->revision);	codec->spdif_support = spdif_support;	if (pcm_streams < 1)		pcm_streams = 1;	if (pcm_streams > 32)		pcm_streams = 32;		pci_set_master(pci);	pci_read_config_word(pci, PCI_COMMAND, &cmdw);	if ((cmdw & PCI_COMMAND_IO) != PCI_COMMAND_IO) {		cmdw |= PCI_COMMAND_IO;		pci_write_config_word(pci, PCI_COMMAND, cmdw);	}	pci_set_master(pci);		if (snd_ali_resources(codec)) {		snd_ali_free(codec);		return -EBUSY;	}	synchronize_irq(pci->irq);	codec->synth.chmap = 0;	codec->synth.chcnt = 0;	codec->spdif_mask = 0;	codec->synth.synthcount = 0;	if (codec->revision == ALI_5451_V02)		codec->chregs.regs.ac97read = ALI_AC97_WRITE;	else		codec->chregs.regs.ac97read = ALI_AC97_READ;	codec->chregs.regs.ac97write = ALI_AC97_WRITE;	codec->chregs.regs.start  = ALI_START;	codec->chregs.regs.stop   = ALI_STOP;	codec->chregs.regs.aint   = ALI_AINT;	codec->chregs.regs.ainten = ALI_AINTEN;	codec->chregs.data.start  = 0x00;	codec->chregs.data.stop   = 0x00;	codec->chregs.data.aint   = 0x00;	codec->chregs.data.ainten = 0x00;	/* M1533: southbridge */	pci_dev = pci_get_device(0x10b9, 0x1533, NULL);	codec->pci_m1533 = pci_dev;	if (! codec->pci_m1533) {		snd_printk(KERN_ERR "ali5451: cannot find ALi 1533 chip.\n");		snd_ali_free(codec);		return -ENODEV;	}	/* M7101: power management */	pci_dev = pci_get_device(0x10b9, 0x7101, NULL);	codec->pci_m7101 = pci_dev;	if (! codec->pci_m7101 && codec->revision == ALI_5451_V02) {		snd_printk(KERN_ERR "ali5451: cannot find ALi 7101 chip.\n");		snd_ali_free(codec);		return -ENODEV;	}	snd_ali_printk("snd_device_new is called.\n");	if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, codec, &ops)) < 0) {		snd_ali_free(codec);		return err;	}	/* initialise synth voices*/	for (i = 0; i < ALI_CHANNELS; i++ ) {		codec->synth.voices[i].number = i;	}	if ((err = snd_ali_chip_init(codec)) < 0) {		snd_printk("ali create: chip init error.\n");		return err;	}#ifdef CONFIG_PM	codec->image = kmalloc(sizeof(*codec->image), GFP_KERNEL);	if (! codec->image)		snd_printk(KERN_WARNING "can't allocate apm buffer\n");	else		snd_card_set_pm_callback(card, ali_suspend, ali_resume, codec);#endif	snd_ali_enable_address_interrupt(codec);	codec->hw_initialized = 1;	*r_ali = codec;	snd_ali_printk("created.\n");	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/ali5451.c/buggy/sound/pci/ali5451/ali5451.c