kobject: kobject_shadow_add cleanup
authorDmitriy Monakhov <dmonakhov@openvz.org>
Sat, 10 Mar 2007 11:00:10 +0000 (14:00 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 27 Apr 2007 17:57:28 +0000 (10:57 -0700)
 - correct function name in comments
 - parrent assignment does metter only inside "if" block,
   so move it inside this block.

Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
lib/kobject.c

index f6645515560643335267a27adaed76a0509c1648..bbbfab4145e6fc988a858726675e98dfc936a6f6 100644 (file)
@@ -157,7 +157,7 @@ static void unlink(struct kobject * kobj)
 }
 
 /**
- *     kobject_add - add an object to the hierarchy.
+ *     kobject_shadow_add - add an object to the hierarchy.
  *     @kobj:  object.
  *     @shadow_parent: sysfs directory to add to.
  */
@@ -190,8 +190,8 @@ int kobject_shadow_add(struct kobject * kobj, struct dentry *shadow_parent)
 
                list_add_tail(&kobj->entry,&kobj->kset->list);
                spin_unlock(&kobj->kset->list_lock);
+               kobj->parent = parent;
        }
-       kobj->parent = parent;
 
        error = create_dir(kobj, shadow_parent);
        if (error) {