printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n", 
printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n", 
static int __devinit bttv_probe(struct pci_dev *dev,				const struct pci_device_id *pci_id){	int result;	unsigned char lat;	struct bttv *btv;	if (bttv_num == BTTV_MAX)		return -ENOMEM;	printk(KERN_INFO "bttv: Bt8xx card found (%d).\n", bttv_num);        btv=&bttvs[bttv_num];	memset(btv,0,sizeof(*btv));	btv->c.nr  = bttv_num;	sprintf(btv->c.name,"bttv%d",btv->c.nr);	/* initialize structs / fill in defaults */        init_MUTEX(&btv->lock);        init_MUTEX(&btv->reslock);        spin_lock_init(&btv->s_lock);        spin_lock_init(&btv->gpio_lock);        init_waitqueue_head(&btv->gpioq);        init_waitqueue_head(&btv->i2c_queue);        INIT_LIST_HEAD(&btv->c.subs);        INIT_LIST_HEAD(&btv->capture);        INIT_LIST_HEAD(&btv->vcapture);	v4l2_prio_init(&btv->prio);	init_timer(&btv->timeout);	btv->timeout.function = bttv_irq_timeout;	btv->timeout.data     = (unsigned long)btv;	btv->i2c_rc = -1;	btv->tuner_type  = UNSET;	btv->pinnacle_id = UNSET;	btv->new_input   = UNSET;	btv->has_radio=radio[btv->c.nr];	/* pci stuff (init, get irq/mmio, ... */	btv->c.pci = dev;	btv->id  = dev->device;	if (pci_enable_device(dev)) {		printk(KERN_WARNING "bttv%d: Can't enable device.\n",		       btv->c.nr);		return -EIO;	}        if (pci_set_dma_mask(dev, DMA_32BIT_MASK)) {                printk(KERN_WARNING "bttv%d: No suitable DMA available.\n",		       btv->c.nr);		return -EIO;        }	if (!request_mem_region(pci_resource_start(dev,0),				pci_resource_len(dev,0),				btv->c.name)) {                printk(KERN_WARNING "bttv%d: can't request iomem (0x%lx).\n",		       btv->c.nr, pci_resource_start(dev,0));		return -EBUSY;	}        pci_set_master(dev);	pci_set_command(dev);	pci_set_drvdata(dev,btv);        pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision);        pci_read_config_byte(dev, PCI_LATENCY_TIMER, &lat);        printk(KERN_INFO "bttv%d: Bt%d (rev %d) at %s, ",               bttv_num,btv->id, btv->revision, pci_name(dev));        printk("irq: %d, latency: %d, mmio: 0x%lx\n",	       btv->c.pci->irq, lat, pci_resource_start(dev,0));	schedule();	btv->bt848_mmio=ioremap(pci_resource_start(dev,0), 0x1000);	if (NULL == ioremap(pci_resource_start(dev,0), 0x1000)) {		printk("bttv%d: ioremap() failed\n", btv->c.nr);		result = -EIO;		goto fail1;	}        /* identify card */	bttv_idcard(btv);        /* disable irqs, register irq handler */	btwrite(0, BT848_INT_MASK);        result = request_irq(btv->c.pci->irq, bttv_irq,                             SA_SHIRQ | SA_INTERRUPT,btv->c.name,(void *)btv);        if (result < 0) {                printk(KERN_ERR "bttv%d: can't get IRQ %d\n",		       bttv_num,btv->c.pci->irq);		goto fail1;        }	if (0 != bttv_handle_chipset(btv)) {		result = -EIO;		goto fail2;        }	/* init options from insmod args */	btv->opt_combfilter = combfilter;	btv->opt_lumafilter = lumafilter;	btv->opt_automute   = automute;	btv->opt_chroma_agc = chroma_agc;	btv->opt_adc_crush  = adc_crush;	btv->opt_vcr_hack   = vcr_hack;	btv->opt_whitecrush_upper  = whitecrush_upper;	btv->opt_whitecrush_lower  = whitecrush_lower;	btv->opt_uv_ratio   = uv_ratio;	btv->opt_full_luma_range   = full_luma_range;	btv->opt_coring     = coring;	/* fill struct bttv with some useful defaults */	btv->init.btv         = btv;	btv->init.ov.w.width  = 320;	btv->init.ov.w.height = 240;	btv->init.fmt         = format_by_palette(VIDEO_PALETTE_RGB24);	btv->init.width       = 320;	btv->init.height      = 240;	btv->init.lines       = 16;	btv->input = 0;	/* initialize hardware */        if (bttv_gpio)                bttv_gpio_tracking(btv,"pre-init");	bttv_risc_init_main(btv);	init_bt848(btv);	/* gpio */        btwrite(0x00, BT848_GPIO_REG_INP);        btwrite(0x00, BT848_GPIO_OUT_EN);        if (bttv_verbose)                bttv_gpio_tracking(btv,"init");        /* needs to be done before i2c is registered */        bttv_init_card1(btv);        /* register i2c + gpio */        init_bttv_i2c(btv);        /* some card-specific stuff (needs working i2c) */        bttv_init_card2(btv);	init_irqreg(btv);        /* register video4linux + input */	if (!bttv_tvcards[btv->c.type].no_video) {		bttv_register_video(btv);		bt848_bright(btv,32768);		bt848_contrast(btv,32768);		bt848_hue(btv,32768);		bt848_sat(btv,32768);		audio_mux(btv,AUDIO_MUTE);		set_input(btv,0);	}	/* add subdevices */	if (btv->has_remote)		bttv_sub_add_device(&btv->c, "remote");	if (bttv_tvcards[btv->c.type].has_dvb)		bttv_sub_add_device(&btv->c, "dvb");	/* everything is fine */	bttv_num++;        return 0; fail2:        free_irq(btv->c.pci->irq,btv); fail1:	if (btv->bt848_mmio)		iounmap(btv->bt848_mmio);	release_mem_region(pci_resource_start(btv->c.pci,0),			   pci_resource_len(btv->c.pci,0));	pci_set_drvdata(dev,NULL);	return result;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4ac97914c6c35f6bf132071c718e034d0846b9f5/bttv-driver.c/buggy/drivers/media/video/bttv-driver.c