]> git.hungrycats.org Git - linux/commitdiff
[PATCH] back out fbdev sysfs support
authorChristoph Hellwig <hch@lst.de>
Sat, 14 Feb 2004 01:04:00 +0000 (17:04 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 14 Feb 2004 01:04:00 +0000 (17:04 -0800)
This backs out James' sysfs support for fbdev again.  It introduces a
big, race for every driver not converted to framebuffer_{alloc,release}
(that is every driver but Ben's new radeonfb).

I've left in framebuffer_{alloc,release} as stubs so drivers can be
converted to it gradually and once all drivers are done it can be
enabled again.

drivers/video/fbmem.c
drivers/video/fbsysfs.c
include/linux/fb.h

index 7b5d4e31c0cb65d794a2fdb490a8b6a7b3f2043e..bff474679be9d14a63fe5d913d16ff606fa90a78 100644 (file)
@@ -1228,9 +1228,6 @@ register_framebuffer(struct fb_info *fb_info)
                        break;
        fb_info->node = i;
        
-       if (fb_add_class_device(fb_info))
-               return -EINVAL;
-       
        if (fb_info->pixmap.addr == NULL) {
                fb_info->pixmap.addr = kmalloc(FBPIXMAPSIZE, GFP_KERNEL);
                if (fb_info->pixmap.addr) {
@@ -1279,7 +1276,6 @@ unregister_framebuffer(struct fb_info *fb_info)
                kfree(fb_info->pixmap.addr);
        registered_fb[i]=NULL;
        num_registered_fb--;
-       class_device_del(&fb_info->class_dev);
        return 0;
 }
 
@@ -1307,8 +1303,6 @@ fbmem_init(void)
        if (register_chrdev(FB_MAJOR,"fb",&fb_fops))
                printk("unable to get major %d for fb devs\n", FB_MAJOR);
 
-       class_register(&fb_class);
-       
 #ifdef CONFIG_FB_OF
        if (ofonly) {
                offb_init();
index 13a51f3bcc1c55c6285a9f10eb8556426eea3149..8b3bbe0c641bb15d085718529e4f19a051f51921 100644 (file)
@@ -9,50 +9,15 @@
  *     2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
+/*
+ * Note:  currently there's only stubs for framebuffer_alloc and
+ * framebuffer_release here.  The reson for that is that until all drivers
+ * are converted to use it a sysfsification will open OOPSable races.
+ */
+
 #include <linux/kernel.h>
 #include <linux/fb.h>
 
-#define to_fb_info(class) container_of(class, struct fb_info, class_dev)
-
-static void release_fb_info(struct class_device *class_dev)
-{
-       struct fb_info *info = to_fb_info(class_dev);
-
-       /* This doesn't harm */
-       fb_dealloc_cmap(&info->cmap);
-
-       kfree(info);
-}
-
-struct class fb_class = {
-       .name           = "graphics",
-       .release        = &release_fb_info,
-};
-
-static ssize_t show_dev(struct class_device *class_dev, char *buf)
-{
-       struct fb_info *info = to_fb_info(class_dev);
-
-       return sprintf(buf, "%u:%u\n", FB_MAJOR, info->node);
-}
-
-static CLASS_DEVICE_ATTR(dev, S_IRUGO, show_dev, NULL);
-
-int fb_add_class_device(struct fb_info *info)
-{
-       int retval;
-
-       info->class_dev.class = &fb_class;
-       snprintf(info->class_dev.class_id, BUS_ID_SIZE, "fb%d",
-                info->node);
-       retval = class_device_register(&info->class_dev);
-       if (retval)
-               return retval;
-       return class_device_create_file(&info->class_dev,
-                                       &class_device_attr_dev);
-}
-
 /**
  * framebuffer_alloc - creates a new frame buffer info structure
  *
@@ -82,7 +47,6 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
                return NULL;
        memset(p, 0, fb_info_size + size);
        info = (struct fb_info *) p;
-       info->class_dev.dev = dev;
 
        if (size)
                info->par = p + fb_info_size;
@@ -103,7 +67,7 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
  */
 void framebuffer_release(struct fb_info *info)
 {
-       class_device_put(&info->class_dev);
+       kfree(info);
 }
 
 EXPORT_SYMBOL(framebuffer_release);
index e429edf7224dbbf19ca587c1bc2c1165fc0b32eb..b4a8f5c48312748b0b90759f10cacb444e7b05e1 100644 (file)
@@ -448,7 +448,6 @@ struct fb_info {
        char *screen_base;              /* Virtual address */
        struct vc_data *display_fg;     /* Console visible on this display */
        int currcon;                    /* Current VC. */
-       struct class_device class_dev;  /* Sysfs data */        
        void *pseudo_palette;           /* Fake palette of 16 colors */ 
        /* From here on everything is device dependent */
        void *par;      
@@ -533,9 +532,6 @@ extern int num_registered_fb;
 /* drivers/video/fbsysfs.c */
 extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
 extern void framebuffer_release(struct fb_info *info);
-extern int fb_add_class_device(struct fb_info *info);
-
-extern struct class fb_class;
 
 /* drivers/video/fbmon.c */
 #define FB_MAXTIMINGS       0