diff options
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r-- | drivers/base/class.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index ba6745b0fd2f..624b3316e938 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kdev_t.h> | 17 | #include <linux/kdev_t.h> |
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include <linux/genhd.h> | ||
20 | #include "base.h" | 21 | #include "base.h" |
21 | 22 | ||
22 | #define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr) | 23 | #define to_class_attr(_attr) container_of(_attr, struct class_attribute, attr) |
@@ -149,7 +150,13 @@ int class_register(struct class * cls) | |||
149 | if (error) | 150 | if (error) |
150 | return error; | 151 | return error; |
151 | 152 | ||
153 | #ifdef CONFIG_SYSFS_DEPRECATED | ||
154 | /* let the block class directory show up in the root of sysfs */ | ||
155 | if (cls != &block_class) | ||
156 | cls->subsys.kobj.kset = class_kset; | ||
157 | #else | ||
152 | cls->subsys.kobj.kset = class_kset; | 158 | cls->subsys.kobj.kset = class_kset; |
159 | #endif | ||
153 | cls->subsys.kobj.ktype = &class_ktype; | 160 | cls->subsys.kobj.ktype = &class_ktype; |
154 | 161 | ||
155 | error = kset_register(&cls->subsys); | 162 | error = kset_register(&cls->subsys); |