pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER,  &dev->pci_lat); printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " 
pci_read_config_byte(pci_dev, PCI_LATENCY_TIMER,  &dev->pci_lat); printk(KERN_INFO "%s/0: found at %s, rev: %d, irq: %d, " 
static int __devinit cx8800_initdev(struct pci_dev *pci_dev,				    const struct pci_device_id *pci_id){	struct cx8800_dev *dev;	struct cx88_core *core;	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 fail_free;	}	core = cx88_core_get(dev->pci);	if (NULL == core) {		err = -EINVAL;		goto fail_free;	}	dev->core = core;	/* 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/0: found at %s, rev: %d, irq: %d, "	       "latency: %d, mmio: 0x%lx\n", core->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/0: Oops: no 32bit PCI DMA ???\n",core->name);		err = -EIO;		goto fail_core;	}	/* initialize driver struct */	spin_lock_init(&dev->slock);	core->tvnorm = tvnorms;	/* init video dma queues */	INIT_LIST_HEAD(&dev->vidq.active);	INIT_LIST_HEAD(&dev->vidq.queued);	dev->vidq.timeout.function = cx8800_vid_timeout;	dev->vidq.timeout.data     = (unsigned long)dev;	init_timer(&dev->vidq.timeout);	cx88_risc_stopper(dev->pci,&dev->vidq.stopper,			  MO_VID_DMACNTRL,0x11,0x00);	/* init vbi dma queues */	INIT_LIST_HEAD(&dev->vbiq.active);	INIT_LIST_HEAD(&dev->vbiq.queued);	dev->vbiq.timeout.function = cx8800_vbi_timeout;	dev->vbiq.timeout.data     = (unsigned long)dev;	init_timer(&dev->vbiq.timeout);	cx88_risc_stopper(dev->pci,&dev->vbiq.stopper,			  MO_VID_DMACNTRL,0x88,0x00);	/* get irq */	err = request_irq(pci_dev->irq, cx8800_irq,			  SA_SHIRQ | SA_INTERRUPT, core->name, dev);	if (err < 0) {		printk(KERN_ERR "%s: can't get IRQ %d\n",		       core->name,pci_dev->irq);		goto fail_core;	}	cx_set(MO_PCI_INTMSK, core->pci_irqmask);	/* load and configure helper modules */	if (TUNER_ABSENT != core->tuner_type)		request_module("tuner");	if (core->tda9887_conf)		request_module("tda9887");	/* register v4l devices */	dev->video_dev = cx88_vdev_init(core,dev->pci,					&cx8800_video_template,"video");	err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,				    video_nr[core->nr]);	if (err < 0) {		printk(KERN_INFO "%s: can't register video device\n",		       core->name);		goto fail_unreg;	}	printk(KERN_INFO "%s/0: registered device video%d [v4l2]\n",	       core->name,dev->video_dev->minor & 0x1f);	dev->vbi_dev = cx88_vdev_init(core,dev->pci,&cx8800_vbi_template,"vbi");	err = video_register_device(dev->vbi_dev,VFL_TYPE_VBI,				    vbi_nr[core->nr]);	if (err < 0) {		printk(KERN_INFO "%s/0: can't register vbi device\n",		       core->name);		goto fail_unreg;	}	printk(KERN_INFO "%s/0: registered device vbi%d\n",	       core->name,dev->vbi_dev->minor & 0x1f);	if (core->has_radio) {		dev->radio_dev = cx88_vdev_init(core,dev->pci,						&cx8800_radio_template,"radio");		err = video_register_device(dev->radio_dev,VFL_TYPE_RADIO,					    radio_nr[core->nr]);		if (err < 0) {			printk(KERN_INFO "%s/0: can't register radio device\n",			       core->name);			goto fail_unreg;		}		printk(KERN_INFO "%s/0: registered device radio%d\n",		       core->name,dev->radio_dev->minor & 0x1f);	}	/* everything worked */	list_add_tail(&dev->devlist,&cx8800_devlist);	pci_set_drvdata(pci_dev,dev);	/* initial device configuration */	down(&core->lock);	init_controls(core);	cx88_set_tvnorm(core,tvnorms);	video_mux(core,0);	up(&core->lock);	/* start tvaudio thread */	if (core->tuner_type != TUNER_ABSENT)		core->kthread = kthread_run(cx88_audio_thread, core, "cx88 tvaudio");	return 0;fail_unreg:	cx8800_unregister_video(dev);	free_irq(pci_dev->irq, dev);fail_core:	cx88_core_put(core,dev->pci);fail_free:	kfree(dev);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/cx88-video.c/buggy/drivers/media/video/cx88/cx88-video.c