info=framebuffer_alloc(sizeof(struct w100fb_par), dev); 
info=framebuffer_alloc(sizeof(struct w100fb_par), &pdev->dev); 
int __init w100fb_probe(struct platform_device *pdev){	int err = -EIO;	struct w100fb_mach_info *inf;	struct fb_info *info = NULL;	struct w100fb_par *par;	struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);	unsigned int chip_id;	if (!mem)		return -EINVAL;	/* Remap the chip base address */	remapped_base = ioremap_nocache(mem->start+W100_CFG_BASE, W100_CFG_LEN);	if (remapped_base == NULL)		goto out;	/* Map the register space */	remapped_regs = ioremap_nocache(mem->start+W100_REG_BASE, W100_REG_LEN);	if (remapped_regs == NULL)		goto out;	/* Identify the chip */	printk("Found ");	chip_id = readl(remapped_regs + mmCHIP_ID);	switch(chip_id) {		case CHIP_ID_W100:  printk("w100");  break;		case CHIP_ID_W3200: printk("w3200"); break;		case CHIP_ID_W3220: printk("w3220"); break;		default:			printk("Unknown imageon chip ID\n");			err = -ENODEV;			goto out;	}	printk(" at 0x%08lx.\n", mem->start+W100_CFG_BASE);	/* Remap the framebuffer */	remapped_fbuf = ioremap_nocache(mem->start+MEM_WINDOW_BASE, MEM_WINDOW_SIZE);	if (remapped_fbuf == NULL)		goto out;	info=framebuffer_alloc(sizeof(struct w100fb_par), dev);	if (!info) {		err = -ENOMEM;		goto out;	}	par = info->par;	platform_set_drvdata(pdev, info);	inf = pdev->dev.platform_data;	par->chip_id = chip_id;	par->mach = inf;	par->fastpll_mode = 0;	par->blanked = 0;	par->pll_table=w100_get_xtal_table(inf->xtal_freq);	if (!par->pll_table) {		printk(KERN_ERR "No matching Xtal definition found\n");		err = -EINVAL;		goto out;	}	info->pseudo_palette = kmalloc(sizeof (u32) * MAX_PALETTES, GFP_KERNEL);	if (!info->pseudo_palette) {		err = -ENOMEM;		goto out;	}	info->fbops = &w100fb_ops;	info->flags = FBINFO_DEFAULT;	info->node = -1;	info->screen_base = remapped_fbuf + (W100_FB_BASE-MEM_WINDOW_BASE);	info->screen_size = REMAPPED_FB_LEN;	strcpy(info->fix.id, "w100fb");	info->fix.type = FB_TYPE_PACKED_PIXELS;	info->fix.type_aux = 0;	info->fix.accel = FB_ACCEL_NONE;	info->fix.smem_start = mem->start+W100_FB_BASE;	info->fix.mmio_start = mem->start+W100_REG_BASE;	info->fix.mmio_len = W100_REG_LEN;	if (fb_alloc_cmap(&info->cmap, 256, 0) < 0) {		err = -ENOMEM;		goto out;	}	par->mode = &inf->modelist[0];	if(inf->init_mode & INIT_MODE_ROTATED) {		info->var.xres = par->mode->yres;		info->var.yres = par->mode->xres;	}	else {		info->var.xres = par->mode->xres;		info->var.yres = par->mode->yres;	}	if(inf->init_mode &= INIT_MODE_FLIPPED)		par->flip = 1;	else		par->flip = 0;	info->var.xres_virtual = info->var.xres;	info->var.yres_virtual = info->var.yres;	info->var.pixclock = 0x04;  /* 171521; */	info->var.sync = 0;	info->var.grayscale = 0;	info->var.xoffset = info->var.yoffset = 0;	info->var.accel_flags = 0;	info->var.activate = FB_ACTIVATE_NOW;	w100_hw_init(par);	if (w100fb_check_var(&info->var, info) < 0) {		err = -EINVAL;		goto out;	}	w100fb_set_par(info);	if (register_framebuffer(info) < 0) {		err = -EINVAL;		goto out;	}	device_create_file(&pdev->dev, &dev_attr_fastpllclk);	device_create_file(&pdev->dev, &dev_attr_reg_read);	device_create_file(&pdev->dev, &dev_attr_reg_write);	device_create_file(&pdev->dev, &dev_attr_flip);	printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id);	return 0;out:	fb_dealloc_cmap(&info->cmap);	kfree(info->pseudo_palette);	if (remapped_fbuf != NULL)		iounmap(remapped_fbuf);	if (remapped_regs != NULL)		iounmap(remapped_regs);	if (remapped_base != NULL)		iounmap(remapped_base);	if (info)		framebuffer_release(info);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/afdd3b3c8ee63c662bafc9194c182610b254c59b/w100fb.c/clean/drivers/video/w100fb.c