[PATCH] maxinefb: New framebuffer_alloc API and class_dev changes
DORMANTno replies
From: Kronos <hidden>
Date: 2003-09-15 20:28:49
Hi, this patch converts driver/video/maxinefb.c to framebuffer_alloc: ======== drivers/video/maxinefb.c 1.20 ======== D 1.20 03/09/13 23:57:10+02:00 kronos@kronoz.cjb.net 21 20 15/9/172 P drivers/video/maxinefb.c C switch to framebuffer_alloc ------------------------------------------------ ===== drivers/video/maxinefb.c 1.19 vs 1.20 =====
--- 1.19/drivers/video/maxinefb.c Thu Apr 24 12:30:41 2003
+++ 1.20/drivers/video/maxinefb.c Sat Sep 13 23:57:10 2003@@ -40,7 +40,7 @@ /* whether are really running on a maxine, KM */ #include <asm/bootinfo.h> -static struct fb_info fb_info; +static struct fb_info *fb_info; static struct fb_var_screeninfo maxinefb_defined = { .xres = 1024,
@@ -131,6 +131,10 @@ return -EINVAL; } + fb_info = framebuffer_alloc(0, NULL); + if (!fb_info) + return -ENOMEM; + printk(KERN_INFO "Maxinefb: Personal DECstation detected\n"); printk(KERN_INFO "Maxinefb: initializing onboard framebuffer\n");
@@ -155,22 +159,24 @@ */ } - fb_info.fbops = &maxinefb_ops; - fb_info.screen_base = (char *) maxinefb_fix.smem_start; - fb_info.var = maxinefb_defined; - fb_info.fix = maxinefb_fix; - fb_info.flags = FBINFO_FLAG_DEFAULT; + fb_info->fbops = &maxinefb_ops; + fb_info->screen_base = (char *) maxinefb_fix.smem_start; + fb_info->var = maxinefb_defined; + fb_info->fix = maxinefb_fix; + fb_info->flags = FBINFO_FLAG_DEFAULT; - fb_alloc_cmap(&fb_info.cmap, 256, 0); + fb_alloc_cmap(&fb_info->cmap, 256, 0); - if (register_framebuffer(&fb_info) < 0) + if (register_framebuffer(fb_info) < 0) { + kfree(fb_info); return 1; + } return 0; } static void __exit maxinefb_exit(void) { - unregister_framebuffer(&fb_info); + unregister_framebuffer(fb_info); } #ifdef MODULE
Luca -- Reply-To: kronos@kronoz.cjb.net Home: http://kronoz.cjb.net La vasca da bagno fu inventata nel 1850, il telefono nel 1875. Se fossi vissuto nel 1850, avrei potuto restare in vasca per 25 anni senza sentir squillare il telefono ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf