]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/gbefb.c
[PATCH] Alchemy PCMCIA: Fix config.h inclusion
[linux-2.6-omap-h63xx.git] / drivers / video / gbefb.c
index 485604cd446268661ee82aa2bfc6d44bad0d8ae9..9d5e4f342110acb4dbf34b3f8a835a2d1daaaf69 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <linux/config.h>
 #include <linux/delay.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
 #include <linux/errno.h>
 #include <linux/fb.h>
@@ -1038,7 +1038,6 @@ static struct fb_ops gbefb_ops = {
        .fb_fillrect    = cfb_fillrect,
        .fb_copyarea    = cfb_copyarea,
        .fb_imageblit   = cfb_imageblit,
-       .fb_cursor      = soft_cursor,
 };
 
 /*
@@ -1260,24 +1259,30 @@ static struct device_driver gbefb_driver = {
        .remove = __devexit_p(gbefb_remove),
 };
 
-static struct platform_device gbefb_device = {
-       .name = "gbefb",
-};
+static struct platform_device *gbefb_device;
 
 int __init gbefb_init(void)
 {
        int ret = driver_register(&gbefb_driver);
        if (!ret) {
-               ret = platform_device_register(&gbefb_device);
-               if (ret)
+               gbefb_device = platform_device_alloc("gbefb", 0);
+               if (gbefb_device) {
+                       ret = platform_device_add(gbefb_device);
+               } else {
+                       ret = -ENOMEM;
+               }
+               if (ret) {
+                       platform_device_put(gbefb_device);
                        driver_unregister(&gbefb_driver);
+               }
        }
        return ret;
 }
 
 void __exit gbefb_exit(void)
 {
-        driver_unregister(&gbefb_driver);
+       platform_device_unregister(gbefb_device);
+       driver_unregister(&gbefb_driver);
 }
 
 module_init(gbefb_init);