Skip to contentSkip to conversation

kobject: kobject_shadow_add cleanup

PATCH New Dmitriy Monakhov 1 participant 1 message Mar 10, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kobject: kobject_shadow_add cleanup

- correct function name in comments
- parrent assignment does metter only inside "if" block, so move it inside this block.

lib/kobject.c +2 -2
index b94f208..e4b477d 100644
@@ -201,7 +201,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.
  */
@@ -234,8 +234,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) {