X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fvideo%2Fcontrolfb.c;h=fd60dba294dabf28882b3d2084fd1bc23ecf8828;hb=d4130b18f7ae5adfe2fd5761e31803554d090aa9;hp=03798e9c882d813d2ab0a62a1b85f5e3272273f8;hpb=cc5d0189b9ba95260857a5018a1c2fef90008507;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c index 03798e9..fd60dba 100644 --- a/drivers/video/controlfb.c +++ b/drivers/video/controlfb.c @@ -31,13 +31,11 @@ * more details. */ -#include #include #include #include #include #include -#include #include #include #include @@ -128,7 +126,7 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var, static int controlfb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, u_int transp, struct fb_info *info); static int controlfb_blank(int blank_mode, struct fb_info *info); -static int controlfb_mmap(struct fb_info *info, struct file *file, +static int controlfb_mmap(struct fb_info *info, struct vm_area_struct *vma); static int controlfb_set_par (struct fb_info *info); static int controlfb_check_var (struct fb_var_screeninfo *var, struct fb_info *info); @@ -280,7 +278,7 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var, * for controlfb. * Note there's no locking in here; it's done in fb_mmap() in fbmem.c. */ -static int controlfb_mmap(struct fb_info *info, struct file *file, +static int controlfb_mmap(struct fb_info *info, struct vm_area_struct *vma) { unsigned long off, start; @@ -417,13 +415,15 @@ static int __init init_control(struct fb_info_control *p) full = p->total_vram == 0x400000; /* Try to pick a video mode out of NVRAM if we have one. */ +#ifdef CONFIG_NVRAM if (default_cmode == CMODE_NVRAM){ cmode = nvram_read_byte(NV_CMODE); if(cmode < CMODE_8 || cmode > CMODE_32) cmode = CMODE_8; } else +#endif cmode=default_cmode; - +#ifdef CONFIG_NVRAM if (default_vmode == VMODE_NVRAM) { vmode = nvram_read_byte(NV_VMODE); if (vmode < 1 || vmode > VMODE_MAX || @@ -434,7 +434,9 @@ static int __init init_control(struct fb_info_control *p) if (control_mac_modes[vmode - 1].m[full] < cmode) vmode = VMODE_640_480_60; } - } else { + } else +#endif + { vmode=default_vmode; if (control_mac_modes[vmode - 1].m[full] < cmode) { if (cmode > CMODE_8) @@ -694,11 +696,10 @@ static int __init control_of_init(struct device_node *dp) printk(KERN_ERR "can't get 2 addresses for control\n"); return -ENXIO; } - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kzalloc(sizeof(*p), GFP_KERNEL); if (p == 0) return -ENXIO; control_fb = p; /* save it for cleanups */ - memset(p, 0, sizeof(*p)); /* Map in frame buffer and registers */ p->fb_orig_base = fb_res.start;