if (card_is_empress(dev)) { 
if (card_is_empress(dev)) { 
static int __devinit saa7134_initdev(struct pci_dev *pci_dev,				     const struct pci_device_id *pci_id){	struct saa7134_dev *dev;	struct list_head *item;	struct saa7134_mpeg_ops *mops;	int err;	dev = kmalloc(sizeof(*dev),GFP_KERNEL);	if (NULL == dev)		return -ENOMEM;	memset(dev,0,sizeof(*dev));	/* pci init */	dev->pci = pci_dev;	if (pci_enable_device(pci_dev)) {		err = -EIO;		goto fail1;	}	dev->nr = saa7134_devcount;	sprintf(dev->name,"saa%x[%d]",pci_dev->device,dev->nr);	/* pci quirks */	if (pci_pci_problems) {		if (pci_pci_problems & PCIPCI_TRITON)			printk(KERN_INFO "%s: quirk: PCIPCI_TRITON\n", dev->name);		if (pci_pci_problems & PCIPCI_NATOMA)			printk(KERN_INFO "%s: quirk: PCIPCI_NATOMA\n", dev->name);		if (pci_pci_problems & PCIPCI_VIAETBF)			printk(KERN_INFO "%s: quirk: PCIPCI_VIAETBF\n", dev->name);		if (pci_pci_problems & PCIPCI_VSFX)			printk(KERN_INFO "%s: quirk: PCIPCI_VSFX\n",dev->name);#ifdef PCIPCI_ALIMAGIK		if (pci_pci_problems & PCIPCI_ALIMAGIK) {			printk(KERN_INFO "%s: quirk: PCIPCI_ALIMAGIK -- latency fixup\n",			       dev->name);			latency = 0x0A;		}#endif	}	if (UNSET != latency) {		printk(KERN_INFO "%s: setting pci latency timer to %d\n",		       dev->name,latency);		pci_write_config_byte(pci_dev, PCI_LATENCY_TIMER, latency);	}	/* print pci info */	pci_read_config_byte(pci_dev, PCI_CLASS_REVISION, &dev->pci_rev);        pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER,  &dev->pci_lat);        printk(KERN_INFO "%s: found at %s, rev: %d, irq: %d, "	       "latency: %d, mmio: 0x%lx\n", dev->name,	       pci_name(pci_dev), dev->pci_rev, pci_dev->irq,	       dev->pci_lat,pci_resource_start(pci_dev,0));	pci_set_master(pci_dev);	if (!pci_dma_supported(pci_dev,0xffffffff)) {		printk("%s: Oops: no 32bit PCI DMA ???\n",dev->name);		err = -EIO;		goto fail1;	}	/* board config */	dev->board = pci_id->driver_data;	if (card[dev->nr] >= 0 &&	    card[dev->nr] < saa7134_bcount)		dev->board = card[dev->nr];	if (SAA7134_BOARD_NOAUTO == dev->board) {		must_configure_manually();		dev->board = SAA7134_BOARD_UNKNOWN;	}	dev->tuner_type   = saa7134_boards[dev->board].tuner_type;	dev->tda9887_conf = saa7134_boards[dev->board].tda9887_conf;	if (UNSET != tuner[dev->nr])		dev->tuner_type = tuner[dev->nr];        printk(KERN_INFO "%s: subsystem: %04x:%04x, board: %s [card=%d,%s]\n",	       dev->name,pci_dev->subsystem_vendor,	       pci_dev->subsystem_device,saa7134_boards[dev->board].name,	       dev->board, card[dev->nr] == dev->board ?	       "insmod option" : "autodetected");	/* get mmio */	if (!request_mem_region(pci_resource_start(pci_dev,0),				pci_resource_len(pci_dev,0),				dev->name)) {		err = -EBUSY;		printk(KERN_ERR "%s: can't get MMIO memory @ 0x%lx\n",		       dev->name,pci_resource_start(pci_dev,0));		goto fail1;	}	dev->lmmio = ioremap(pci_resource_start(pci_dev,0), 0x1000);	dev->bmmio = (__u8 __iomem *)dev->lmmio;	if (NULL == dev->lmmio) {		err = -EIO;		printk(KERN_ERR "%s: can't ioremap() MMIO memory\n",		       dev->name);		goto fail2;	}	/* initialize hardware #1 */	saa7134_board_init1(dev);	saa7134_hwinit1(dev);	/* get irq */	err = request_irq(pci_dev->irq, saa7134_irq,			  SA_SHIRQ | SA_INTERRUPT, dev->name, dev);	if (err < 0) {		printk(KERN_ERR "%s: can't get IRQ %d\n",		       dev->name,pci_dev->irq);		goto fail3;	}	/* wait a bit, register i2c bus */	msleep(100);	saa7134_i2c_register(dev);	/* initialize hardware #2 */	saa7134_board_init2(dev);	saa7134_hwinit2(dev);	/* load i2c helpers */	if (TUNER_ABSENT != dev->tuner_type)		request_module("tuner");	if (dev->tda9887_conf)		request_module("tda9887");  	if (card_is_empress(dev)) {		request_module("saa6752hs");		request_module_depend("saa7134-empress",&need_empress);	}  	if (card_is_dvb(dev))		request_module_depend("saa7134-dvb",&need_dvb);	v4l2_prio_init(&dev->prio);	/* register v4l devices */	dev->video_dev = vdev_init(dev,&saa7134_video_template,"video");	err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,				    video_nr[dev->nr]);	if (err < 0) {		printk(KERN_INFO "%s: can't register video device\n",		       dev->name);		goto fail4;	}	printk(KERN_INFO "%s: registered device video%d [v4l2]\n",	       dev->name,dev->video_dev->minor & 0x1f);	dev->vbi_dev = vdev_init(dev,&saa7134_vbi_template,"vbi");	err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,				    vbi_nr[dev->nr]);	if (err < 0)		goto fail4;	printk(KERN_INFO "%s: registered device vbi%d\n",	       dev->name,dev->vbi_dev->minor & 0x1f);	if (card_has_radio(dev)) {		dev->radio_dev = vdev_init(dev,&saa7134_radio_template,"radio");		err = video_register_device(dev->radio_dev,VFL_TYPE_RADIO,					    radio_nr[dev->nr]);		if (err < 0)			goto fail4;		printk(KERN_INFO "%s: registered device radio%d\n",		       dev->name,dev->radio_dev->minor & 0x1f);	}	/* register oss devices */	switch (dev->pci->device) {	case PCI_DEVICE_ID_PHILIPS_SAA7134:	case PCI_DEVICE_ID_PHILIPS_SAA7133:	case PCI_DEVICE_ID_PHILIPS_SAA7135:		if (oss) {			err = dev->oss.minor_dsp =				register_sound_dsp(&saa7134_dsp_fops,						   dsp_nr[dev->nr]);			if (err < 0) {				goto fail4;			}			printk(KERN_INFO "%s: registered device dsp%d\n",			       dev->name,dev->oss.minor_dsp >> 4);			err = dev->oss.minor_mixer =				register_sound_mixer(&saa7134_mixer_fops,						     mixer_nr[dev->nr]);			if (err < 0)				goto fail5;			printk(KERN_INFO "%s: registered device mixer%d\n",			       dev->name,dev->oss.minor_mixer >> 4);		} else if (alsa) {			alsa_card_saa7134_create(dev,dsp_nr[dev->nr]);			printk(KERN_INFO "%s: registered ALSA devices\n",			       dev->name);		}		break;	}	/* everything worked */	pci_set_drvdata(pci_dev,dev);	saa7134_devcount++;	down(&devlist_lock);	list_for_each(item,&mops_list) {		mops = list_entry(item, struct saa7134_mpeg_ops, next);		mpeg_ops_attach(mops, dev);	}	list_add_tail(&dev->devlist,&saa7134_devlist);	up(&devlist_lock);	/* check for signal */	saa7134_irq_video_intl(dev);	return 0; fail5:	switch (dev->pci->device) {	case PCI_DEVICE_ID_PHILIPS_SAA7134:	case PCI_DEVICE_ID_PHILIPS_SAA7133:	case PCI_DEVICE_ID_PHILIPS_SAA7135:		if (oss)			unregister_sound_dsp(dev->oss.minor_dsp);		else if (alsa)			alsa_card_saa7134_exit();		break;	} fail4:	saa7134_unregister_video(dev);	saa7134_i2c_unregister(dev);	free_irq(pci_dev->irq, dev); fail3:	saa7134_hwfini(dev);	iounmap(dev->lmmio); fail2:	release_mem_region(pci_resource_start(pci_dev,0),			   pci_resource_len(pci_dev,0)); fail1:	kfree(dev);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/saa7134-core.c/buggy/drivers/media/video/saa7134/saa7134-core.c