aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/sys.c')
-rw-r--r--drivers/base/sys.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 2f79c55acdcc..8e13fd942163 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -133,6 +133,7 @@ int sysdev_class_register(struct sysdev_class * cls)
133 pr_debug("Registering sysdev class '%s'\n", 133 pr_debug("Registering sysdev class '%s'\n",
134 kobject_name(&cls->kset.kobj)); 134 kobject_name(&cls->kset.kobj));
135 INIT_LIST_HEAD(&cls->drivers); 135 INIT_LIST_HEAD(&cls->drivers);
136 memset(&cls->kset.kobj, 0x00, sizeof(struct kobject));
136 cls->kset.kobj.parent = &system_kset->kobj; 137 cls->kset.kobj.parent = &system_kset->kobj;
137 cls->kset.kobj.ktype = &ktype_sysdev_class; 138 cls->kset.kobj.ktype = &ktype_sysdev_class;
138 cls->kset.kobj.kset = system_kset; 139 cls->kset.kobj.kset = system_kset;
@@ -227,6 +228,9 @@ int sysdev_register(struct sys_device * sysdev)
227 228
228 pr_debug("Registering sys device '%s'\n", kobject_name(&sysdev->kobj)); 229 pr_debug("Registering sys device '%s'\n", kobject_name(&sysdev->kobj));
229 230
231 /* initialize the kobject to 0, in case it had previously been used */
232 memset(&sysdev->kobj, 0x00, sizeof(struct kobject));
233
230 /* Make sure the kset is set */ 234 /* Make sure the kset is set */
231 sysdev->kobj.kset = &cls->kset; 235 sysdev->kobj.kset = &cls->kset;
232 236