diff options
Diffstat (limited to 'drivers/base/class.c')
-rw-r--r-- | drivers/base/class.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index e085af0ff94f..71ce3ff6bdf5 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -148,6 +148,10 @@ int class_register(struct class *cls) | |||
148 | if (error) | 148 | if (error) |
149 | return error; | 149 | return error; |
150 | 150 | ||
151 | /* set the default /sys/dev directory for devices of this class */ | ||
152 | if (!cls->dev_kobj) | ||
153 | cls->dev_kobj = sysfs_dev_char_kobj; | ||
154 | |||
151 | #if defined(CONFIG_SYSFS_DEPRECATED) && defined(CONFIG_BLOCK) | 155 | #if defined(CONFIG_SYSFS_DEPRECATED) && defined(CONFIG_BLOCK) |
152 | /* let the block class directory show up in the root of sysfs */ | 156 | /* let the block class directory show up in the root of sysfs */ |
153 | if (cls != &block_class) | 157 | if (cls != &block_class) |