diff options
Diffstat (limited to 'drivers/base/sys.c')
-rw-r--r-- | drivers/base/sys.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 9742a78c9fe4..79a9ae5238ac 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
@@ -131,6 +131,8 @@ static struct kset *system_kset; | |||
131 | 131 | ||
132 | int sysdev_class_register(struct sysdev_class *cls) | 132 | int sysdev_class_register(struct sysdev_class *cls) |
133 | { | 133 | { |
134 | int retval; | ||
135 | |||
134 | pr_debug("Registering sysdev class '%s'\n", cls->name); | 136 | pr_debug("Registering sysdev class '%s'\n", cls->name); |
135 | 137 | ||
136 | INIT_LIST_HEAD(&cls->drivers); | 138 | INIT_LIST_HEAD(&cls->drivers); |
@@ -138,7 +140,11 @@ int sysdev_class_register(struct sysdev_class *cls) | |||
138 | cls->kset.kobj.parent = &system_kset->kobj; | 140 | cls->kset.kobj.parent = &system_kset->kobj; |
139 | cls->kset.kobj.ktype = &ktype_sysdev_class; | 141 | cls->kset.kobj.ktype = &ktype_sysdev_class; |
140 | cls->kset.kobj.kset = system_kset; | 142 | cls->kset.kobj.kset = system_kset; |
141 | kobject_set_name(&cls->kset.kobj, cls->name); | 143 | |
144 | retval = kobject_set_name(&cls->kset.kobj, "%s", cls->name); | ||
145 | if (retval) | ||
146 | return retval; | ||
147 | |||
142 | return kset_register(&cls->kset); | 148 | return kset_register(&cls->kset); |
143 | } | 149 | } |
144 | 150 | ||