fbdev: move FBIO_WAITFORVSYNC to linux/fb.h
[safe/jmp/linux-2.6] / drivers / video / dnfb.c
index 957a3ad..ec56d25 100644 (file)
@@ -2,8 +2,6 @@
 #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>
@@ -227,9 +225,8 @@ void dnfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
  * Initialization
  */
 
-static int __devinit dnfb_probe(struct device *device)
+static int __devinit dnfb_probe(struct platform_device *dev)
 {
-       struct platform_device *dev = to_platform_device(device);
        struct fb_info *info;
        int err = 0;
 
@@ -257,7 +254,7 @@ static int __devinit dnfb_probe(struct device *device)
                framebuffer_release(info);
                return err;
        }
-       dev_set_drvdata(&dev->dev, info);
+       platform_set_drvdata(dev, info);
 
        /* now we have registered we can safely setup the hardware */
        out_8(AP_CONTROL_3A, RESET_CREG);
@@ -271,10 +268,11 @@ static int __devinit dnfb_probe(struct device *device)
        return err;
 }
 
-static struct device_driver dnfb_driver = {
-       .name   = "dnfb",
-       .bus    = &platform_bus_type,
+static struct platform_driver dnfb_driver = {
        .probe  = dnfb_probe,
+       .driver = {
+               .name   = "dnfb",
+       },
 };
 
 static struct platform_device dnfb_device = {
@@ -285,15 +283,18 @@ int __init dnfb_init(void)
 {
        int ret;
 
+       if (!MACH_IS_APOLLO)
+               return -ENODEV;
+
        if (fb_get_options("dnfb", NULL))
                return -ENODEV;
 
-       ret = driver_register(&dnfb_driver);
+       ret = platform_driver_register(&dnfb_driver);
 
        if (!ret) {
                ret = platform_device_register(&dnfb_device);
                if (ret)
-                       driver_unregister(&dnfb_driver);
+                       platform_driver_unregister(&dnfb_driver);
        }
        return ret;
 }