linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / video / vfb.c
index a9b99b0..53208cb 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
+#include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/delay.h>
@@ -397,6 +398,11 @@ static int __init vfb_setup(char *options)
      *  Initialisation
      */
 
+static void vfb_platform_release(struct device *device)
+{
+       // This is called when the reference count goes to zero.
+}
+
 static int __init vfb_probe(struct platform_device *dev)
 {
        struct fb_info *info;
@@ -475,7 +481,13 @@ static struct platform_driver vfb_driver = {
        },
 };
 
-static struct platform_device *vfb_device;
+static struct platform_device vfb_device = {
+       .name   = "vfb",
+       .id     = 0,
+       .dev    = {
+               .release = vfb_platform_release,
+       }
+};
 
 static int __init vfb_init(void)
 {
@@ -495,19 +507,10 @@ static int __init vfb_init(void)
        ret = platform_driver_register(&vfb_driver);
 
        if (!ret) {
-               vfb_device = platform_device_alloc("vfb", 0);
-
-               if (vfb_device)
-                       ret = platform_device_add(vfb_device);
-               else
-                       ret = -ENOMEM;
-
-               if (ret) {
-                       platform_device_put(vfb_device);
+               ret = platform_device_register(&vfb_device);
+               if (ret)
                        platform_driver_unregister(&vfb_driver);
-               }
        }
-
        return ret;
 }
 
@@ -516,7 +519,7 @@ module_init(vfb_init);
 #ifdef MODULE
 static void __exit vfb_exit(void)
 {
-       platform_device_unregister(vfb_device);
+       platform_device_unregister(&vfb_device);
        platform_driver_unregister(&vfb_driver);
 }