]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/base/class.c
Driver core: convert block from raw kobjects to core devices
[linux-2.6-omap-h63xx.git] / drivers / base / class.c
index ba6745b0fd2fe186505f582b2bb8cb6a0a0a04cf..624b3316e938aebae6f4f27a0ea8a4366274d707 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/kdev_t.h>
 #include <linux/err.h>
 #include <linux/slab.h>
+#include <linux/genhd.h>
 #include "base.h"
 
 #define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr)
@@ -149,7 +150,13 @@ int class_register(struct class * cls)
        if (error)
                return error;
 
+#ifdef CONFIG_SYSFS_DEPRECATED
+       /* let the block class directory show up in the root of sysfs */
+       if (cls != &block_class)
+               cls->subsys.kobj.kset = class_kset;
+#else
        cls->subsys.kobj.kset = class_kset;
+#endif
        cls->subsys.kobj.ktype = &class_ktype;
 
        error = kset_register(&cls->subsys);