vserver 1.9.3
[linux-2.6.git] / drivers / video / aty / atyfb_base.c
index 5e7c2d2..2d753a1 100644 (file)
@@ -1037,7 +1037,7 @@ static int atyfb_ioctl(struct inode *inode, struct file *file, u_int cmd,
                fbtyp.fb_cmsize = info->cmap.len;
                fbtyp.fb_size = info->fix.smem_len;
                if (copy_to_user
-                   ((struct fbtype *) arg, &fbtyp, sizeof(fbtyp)))
+                   ((struct fbtype __user *) arg, &fbtyp, sizeof(fbtyp)))
                        return -EFAULT;
                break;
 #endif                         /* __sparc__ */
@@ -1405,7 +1405,7 @@ static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
                case PBOOK_SLEEP_REJECT:
                        if (par->save_framebuffer) {
                                vfree(par->save_framebuffer);
-                               par->save_framebuffer = 0;
+                               par->save_framebuffer = NULL;
                        }
                        break;
                case PBOOK_SLEEP_NOW:
@@ -1435,7 +1435,7 @@ static int aty_sleep_notify(struct pmu_sleep_notifier *self, int when)
                                memcpy_toio((void *) info->screen_base,
                                            par->save_framebuffer, nb);
                                vfree(par->save_framebuffer);
-                               par->save_framebuffer = 0;
+                               par->save_framebuffer = NULL;
                        }
                        /* Restore display */
                        atyfb_set_par(info);
@@ -1902,7 +1902,7 @@ static int __init aty_init(struct fb_info *info, const char *name)
        return 1;
 }
 
-int __init atyfb_init(void)
+int __init atyfb_do_init(void)
 {
 #if defined(CONFIG_PCI)
        unsigned long addr, res_start, res_size;
@@ -1917,12 +1917,14 @@ int __init atyfb_init(void)
        char prop[128];
        int node, len, j;
        u32 mem, chip_id;
+#else
+       u16 tmp;
+#endif
 
+#ifdef __sparc__
        /* Do not attach when we have a serial console. */
        if (!con_is_present())
                return -ENXIO;
-#else
-       u16 tmp;
 #endif
 
        while ((pdev =
@@ -2377,6 +2379,19 @@ int __init atyfb_init(void)
        return 0;
 }
 
+int __init atyfb_init(void)
+{
+#ifndef MODULE
+       char *option = NULL;
+
+       if (fb_get_options("atyfb", &option))
+               return -ENODEV;
+       atyfb_setup(option);
+#endif
+       return atyfb_do_init();
+}
+
+
 #ifndef MODULE
 int __init atyfb_setup(char *options)
 {
@@ -2445,6 +2460,7 @@ int __init atyfb_setup(char *options)
        }
        return 0;
 }
+module_init(atyfb_init);
 #endif                         /* !MODULE */
 
 #ifdef CONFIG_ATARI