struct fb_monspecs *specs = &info->monspecs; struct fb_videomode modedb; 
struct fb_videomode *modedb; 
static int __devinit savagefb_probe (struct pci_dev* dev,				     const struct pci_device_id* id){	struct fb_info *info;	struct savagefb_par *par;	u_int h_sync, v_sync;	int err, lpitch;	int video_len;	DBG("savagefb_probe");	SavagePrintRegs();	info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev);	if (!info)		return -ENOMEM;	par = info->par;	err = pci_enable_device(dev);	if (err)		goto failed_enable;	if ((err = pci_request_regions(dev, "savagefb"))) {		printk(KERN_ERR "cannot request PCI regions\n");		goto failed_enable;	}	err = -ENOMEM;	if ((err = savage_init_fb_info(info, dev, id)))		goto failed_init;	err = savage_map_mmio(info);	if (err)		goto failed_mmio;	video_len = savage_init_hw(par);	/* FIXME: cant be negative */	if (video_len < 0) {		err = video_len;		goto failed_mmio;	}	err = savage_map_video(info, video_len);	if (err)		goto failed_video;	INIT_LIST_HEAD(&info->modelist);#if defined(CONFIG_FB_SAVAGE_I2C)	savagefb_create_i2c_busses(info);	savagefb_probe_i2c_connector(info, &par->edid);	kfree(par->edid);	fb_edid_to_monspecs(par->edid, &info->monspecs);	fb_videomode_to_modelist(info->monspecs.modedb,				 info->monspecs.modedb_len,				 &info->modelist);#endif	info->var = savagefb_var800x600x8;	if (mode_option) {		fb_find_mode(&info->var, info, mode_option,			     info->monspecs.modedb, info->monspecs.modedb_len,			     NULL, 8);	} else if (info->monspecs.modedb != NULL) {		struct fb_monspecs *specs = &info->monspecs;		struct fb_videomode modedb;		if (info->monspecs.misc & FB_MISC_1ST_DETAIL) {			int i;			for (i = 0; i < specs->modedb_len; i++) {				if (specs->modedb[i].flag & FB_MODE_IS_FIRST) {					modedb = specs->modedb[i];					break;				}			}		} else {			/* otherwise, get first mode in database */			modedb = specs->modedb[0];		}		savage_update_var(&info->var, &modedb);	}	/* maximize virtual vertical length */	lpitch = info->var.xres_virtual*((info->var.bits_per_pixel + 7) >> 3);	info->var.yres_virtual = info->fix.smem_len/lpitch;	if (info->var.yres_virtual < info->var.yres)		goto failed;#if defined(CONFIG_FB_SAVAGE_ACCEL)	/*	 * The clipping coordinates are masked with 0xFFF, so limit our	 * virtual resolutions to these sizes.	 */	if (info->var.yres_virtual > 0x1000)		info->var.yres_virtual = 0x1000;	if (info->var.xres_virtual > 0x1000)		info->var.xres_virtual = 0x1000;#endif	savagefb_check_var(&info->var, info);	savagefb_set_fix(info);	/*	 * Calculate the hsync and vsync frequencies.  Note that	 * we split the 1e12 constant up so that we can preserve	 * the precision and fit the results into 32-bit registers.	 *  (1953125000 * 512 = 1e12)	 */	h_sync = 1953125000 / info->var.pixclock;	h_sync = h_sync * 512 / (info->var.xres + info->var.left_margin +				 info->var.right_margin +				 info->var.hsync_len);	v_sync = h_sync / (info->var.yres + info->var.upper_margin +			   info->var.lower_margin + info->var.vsync_len);	printk(KERN_INFO "savagefb v" SAVAGEFB_VERSION ": "	       "%dkB VRAM, using %dx%d, %d.%03dkHz, %dHz\n",	       info->fix.smem_len >> 10,	       info->var.xres, info->var.yres,	       h_sync / 1000, h_sync % 1000, v_sync);	fb_destroy_modedb(info->monspecs.modedb);	info->monspecs.modedb = NULL;	err = register_framebuffer (info);	if (err < 0)		goto failed;	printk (KERN_INFO "fb: S3 %s frame buffer device\n",		info->fix.id);	/*	 * Our driver data	 */	pci_set_drvdata(dev, info);	return 0; failed:#ifdef CONFIG_FB_SAVAGE_I2C	savagefb_delete_i2c_busses(info);#endif	fb_alloc_cmap (&info->cmap, 0, 0);	savage_unmap_video(info); failed_video:	savage_unmap_mmio (info); failed_mmio:	kfree(info->pixmap.addr); failed_init:	pci_release_regions(dev); failed_enable:	framebuffer_release(info);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/5ee1ef96a0d5c49809c61bdbb30cdda88e1d23cf/savagefb_driver.c/clean/drivers/video/savage/savagefb_driver.c