Add changes from the Linux-2.6 tree.
[linux-2.6.git] / drivers / video / q40fb.c
index 0c7b267..48536c3 100644 (file)
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/platform_device.h>
 
 #include <asm/uaccess.h>
 #include <asm/setup.h>
-#include <asm/segment.h>
 #include <asm/system.h>
 #include <asm/q40_master.h>
 #include <linux/fb.h>
@@ -84,12 +83,10 @@ static struct fb_ops q40fb_ops = {
        .fb_fillrect    = cfb_fillrect,
        .fb_copyarea    = cfb_copyarea,
        .fb_imageblit   = cfb_imageblit,
-       .fb_cursor      = soft_cursor,
 };
 
-static int __init q40fb_probe(struct device *device)
+static int __init q40fb_probe(struct platform_device *dev)
 {
-       struct platform_device *dev = to_platform_device(device);
        struct fb_info *info;
 
        if (!MACH_IS_Q40)
@@ -105,7 +102,7 @@ static int __init q40fb_probe(struct device *device)
        info->var = q40fb_var;
        info->fix = q40fb_fix;
        info->fbops = &q40fb_ops;
-       info->flags = FBINFO_FLAG_DEFAULT;  /* not as module for now */
+       info->flags = FBINFO_DEFAULT;  /* not as module for now */
        info->pseudo_palette = info->par;
        info->par = NULL;
        info->screen_base = (char *) q40fb_fix.smem_start;
@@ -129,10 +126,11 @@ static int __init q40fb_probe(struct device *device)
        return 0;
 }
 
-static struct device_driver q40fb_driver = {
-       .name   = "q40fb",
-       .bus    = &platform_bus_type,
+static struct platform_driver q40fb_driver = {
        .probe  = q40fb_probe,
+       .driver = {
+               .name   = "q40fb",
+       },
 };
 
 static struct platform_device q40fb_device = {
@@ -143,14 +141,18 @@ int __init q40fb_init(void)
 {
        int ret = 0;
 
-       ret = driver_register(&q40fb_driver);
+       if (fb_get_options("q40fb", NULL))
+               return -ENODEV;
+
+       ret = platform_driver_register(&q40fb_driver);
 
        if (!ret) {
                ret = platform_device_register(&q40fb_device);
                if (ret)
-                       driver_unregister(&q40fb_driver);
+                       platform_driver_unregister(&q40fb_driver);
        }
        return ret;
 }
 
+module_init(q40fb_init);
 MODULE_LICENSE("GPL");