aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/sys.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 358bb0be3c08..50690d9df248 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -130,8 +130,8 @@ static struct kset *system_kset;
130 130
131int sysdev_class_register(struct sysdev_class * cls) 131int sysdev_class_register(struct sysdev_class * cls)
132{ 132{
133 pr_debug("Registering sysdev class '%s'\n", 133 pr_debug("Registering sysdev class '%s'\n", cls->name);
134 kobject_name(&cls->kset.kobj)); 134
135 INIT_LIST_HEAD(&cls->drivers); 135 INIT_LIST_HEAD(&cls->drivers);
136 memset(&cls->kset.kobj, 0x00, sizeof(struct kobject)); 136 memset(&cls->kset.kobj, 0x00, sizeof(struct kobject));
137 cls->kset.kobj.parent = &system_kset->kobj; 137 cls->kset.kobj.parent = &system_kset->kobj;
@@ -241,7 +241,8 @@ int sysdev_register(struct sys_device * sysdev)
241 if (!cls) 241 if (!cls)
242 return -EINVAL; 242 return -EINVAL;
243 243
244 pr_debug("Registering sys device '%s'\n", kobject_name(&sysdev->kobj)); 244 pr_debug("Registering sys device of class '%s'\n",
245 kobject_name(&cls->kset.kobj));
245 246
246 /* initialize the kobject to 0, in case it had previously been used */ 247 /* initialize the kobject to 0, in case it had previously been used */
247 memset(&sysdev->kobj, 0x00, sizeof(struct kobject)); 248 memset(&sysdev->kobj, 0x00, sizeof(struct kobject));
@@ -257,6 +258,9 @@ int sysdev_register(struct sys_device * sysdev)
257 if (!error) { 258 if (!error) {
258 struct sysdev_driver * drv; 259 struct sysdev_driver * drv;
259 260
261 pr_debug("Registering sys device '%s'\n",
262 kobject_name(&sysdev->kobj));
263
260 mutex_lock(&sysdev_drivers_lock); 264 mutex_lock(&sysdev_drivers_lock);
261 /* Generic notification is implicit, because it's that 265 /* Generic notification is implicit, because it's that
262 * code that should have called us. 266 * code that should have called us.
@@ -269,6 +273,7 @@ int sysdev_register(struct sys_device * sysdev)
269 } 273 }
270 mutex_unlock(&sysdev_drivers_lock); 274 mutex_unlock(&sysdev_drivers_lock);
271 } 275 }
276
272 kobject_uevent(&sysdev->kobj, KOBJ_ADD); 277 kobject_uevent(&sysdev->kobj, KOBJ_ADD);
273 return error; 278 return error;
274} 279}