Merge master.kernel.org:/home/rmk/linux-2.6-arm
[powerpc.git] / drivers / video / fbmem.c
index a815f5e..70be700 100644 (file)
@@ -90,15 +90,7 @@ EXPORT_SYMBOL(fb_get_color_depth);
  */
 void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height)
 {
-       int i, j;
-
-       for (i = height; i--; ) {
-               /* s_pitch is a few bytes at the most, memcpy is suboptimal */
-               for (j = 0; j < s_pitch; j++)
-                       dst[j] = src[j];
-               src += s_pitch;
-               dst += d_pitch;
-       }
+       __fb_pad_aligned_buffer(dst, d_pitch, src, s_pitch, height);
 }
 EXPORT_SYMBOL(fb_pad_aligned_buffer);
 
@@ -1029,6 +1021,7 @@ register_framebuffer(struct fb_info *fb_info)
 {
        int i;
        struct fb_event event;
+       struct fb_videomode mode;
 
        if (num_registered_fb == FB_MAX)
                return -ENXIO;
@@ -1059,16 +1052,11 @@ register_framebuffer(struct fb_info *fb_info)
        }       
        fb_info->pixmap.offset = 0;
 
-       if (!fb_info->modelist.prev ||
-           !fb_info->modelist.next ||
-           list_empty(&fb_info->modelist)) {
-               struct fb_videomode mode;
-
+       if (!fb_info->modelist.prev || !fb_info->modelist.next)
                INIT_LIST_HEAD(&fb_info->modelist);
-               fb_var_to_videomode(&mode, &fb_info->var);
-               fb_add_videomode(&mode, &fb_info->modelist);
-       }
 
+       fb_var_to_videomode(&mode, &fb_info->var);
+       fb_add_videomode(&mode, &fb_info->modelist);
        registered_fb[i] = fb_info;
 
        devfs_mk_cdev(MKDEV(FB_MAJOR, i),