q40fb: New framebuffer_alloc API and class_dev changes
PATCH 1/1 q40fb: New framebuffer_alloc API and class_dev changes
Hi,
this patch converts driver/video/q40fb.c to framebuffer_alloc:
======== drivers/video/q40fb.c 1.24 ========
D 1.24 03/09/14 00:09:28+02:00 [email protected] 26 25 14/10/117 P drivers/video/q40fb.c
C switch to framebuffer_alloc
------------------------------------------------
===== drivers/video/q40fb.c 1.23 vs 1.24 =====
drivers/video/q40fb.c +14 -10
@@ -31,7 +31,7 @@#define Q40_PHYS_SCREEN_ADDR 0xFE800000static u32 pseudo_palette[17 ]; -static struct fb_info fb_info; +static struct fb_info *fb_info;static struct fb_fix_screeninfo q40fb_fix__initdata = { .id ="Q40" ,
@@ -100,27 +100,31 @@if ( !MACH_IS_Q40 )return -ENXIO ; + fb_info =framebuffer_alloc (0 ,NULL ); +if (!fb_info) +return -ENOMEM ; +/* mapped in q40/config.c */ q40fb_fix.smem_start =Q40_PHYS_SCREEN_ADDR ; - fb_info.var = q40fb_var; - fb_info.fix = q40fb_fix; - fb_info.fbops = &q40fb_ops; - fb_info.flags =FBINFO_FLAG_DEFAULT ;/* not as module for now */ - fb_info.pseudo_palette = pseudo_palette; - fb_info.screen_base = (char *) q40fb_fix.smem_start; + fb_info->var = q40fb_var; + fb_info->fix = q40fb_fix; + fb_info->fbops = &q40fb_ops; + fb_info->flags =FBINFO_FLAG_DEFAULT ;/* not as module for now */ + fb_info->pseudo_palette = pseudo_palette; + fb_info->screen_base = (char *) q40fb_fix.smem_start; -fb_alloc_cmap (&fb_info.cmap,16 ,0 ); +fb_alloc_cmap (&fb_info->cmap,16 ,0 );master_outb (3 ,DISPLAY_CONTROL_REG ); -if (register_framebuffer (&fb_info) <0 ) { +if (register_framebuffer (fb_info) <0 ) {printk (KERN_ERR "Unable to register Q40 frame buffer\n" );return -EINVAL ; }printk (KERN_INFO "fb%d: Q40 frame buffer alive and kicking !\n" , - fb_info.node); + fb_info->node);return 0 ; }
Luca
Signature · 10 lines
Reply-To: [email protected] Home: http://kronoz.cjb.net "Fare l'amore con dieci donne e` fantastico, soprattutto perche` ti presentano un sacco di amiche." -- Fabio Di Iorio ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf