bt878_remove(dev); return -EIO; } 
bt878_remove(dev); return -EIO; } 
static int __devinit bt878_probe(struct pci_dev *dev,				 const struct pci_device_id *pci_id){	int result;	unsigned char lat;	struct bt878 *bt;#if defined(__powerpc__)	unsigned int cmd;#endif	printk(KERN_INFO "bt878: Bt878 AUDIO function found (%d).\n",	       bt878_num);	if (pci_enable_device(dev))		return -EIO;	bt = &bt878[bt878_num];	bt->dev = dev;	bt->nr = bt878_num;	bt->shutdown = 0;	bt->id = dev->device;	bt->irq = dev->irq;	bt->bt878_adr = pci_resource_start(dev, 0);	if (!request_mem_region(pci_resource_start(dev, 0),				pci_resource_len(dev, 0), "bt878")) {		result = -EBUSY;		goto fail0;	}	pci_read_config_byte(dev, PCI_CLASS_REVISION, &bt->revision);	pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);	printk(KERN_INFO "bt878(%d): Bt%x (rev %d) at %02x:%02x.%x, ",	       bt878_num, bt->id, bt->revision, dev->bus->number,	       PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));	printk("irq: %d, latency: %d, memory: 0x%lx\n",	       bt->irq, lat, bt->bt878_adr);#if defined(__powerpc__)	/* on OpenFirmware machines (PowerMac at least), PCI memory cycle */	/* response on cards with no firmware is not enabled by OF */	pci_read_config_dword(dev, PCI_COMMAND, &cmd);	cmd = (cmd | PCI_COMMAND_MEMORY);	pci_write_config_dword(dev, PCI_COMMAND, cmd);#endif#ifdef __sparc__	bt->bt878_mem = (unsigned char *) bt->bt878_adr;#else	bt->bt878_mem = ioremap(bt->bt878_adr, 0x1000);#endif	/* clear interrupt mask */	btwrite(0, BT848_INT_MASK);	result = request_irq(bt->irq, bt878_irq,			     SA_SHIRQ | SA_INTERRUPT, "bt878",			     (void *) bt);	if (result == -EINVAL) {		printk(KERN_ERR "bt878(%d): Bad irq number or handler\n",		       bt878_num);		goto fail1;	}	if (result == -EBUSY) {		printk(KERN_ERR		       "bt878(%d): IRQ %d busy, change your PnP config in BIOS\n",		       bt878_num, bt->irq);		goto fail1;	}	if (result < 0)		goto fail1;	pci_set_master(dev);	pci_set_drvdata(dev, bt);/*        if(init_bt878(btv) < 0) {                bt878_remove(dev);                return -EIO;        }*/	if ((result = bt878_mem_alloc(bt))) {		printk("bt878: failed to allocate memory!\n");		goto fail2;	}	bt878_make_risc(bt);	btwrite(0, BT878_AINT_MASK);	bt878_num++;	return 0;      fail2:	free_irq(bt->irq, bt);      fail1:	release_mem_region(pci_resource_start(bt->dev, 0),			   pci_resource_len(bt->dev, 0));      fail0:	pci_disable_device(dev);	return result;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/50b215a05878ce9636dace6cd21f7e91ff005058/bt878.c/buggy/drivers/media/dvb/bt8xx/bt878.c