Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22010
b: refs/heads/master
c: dcd0da0
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Mar 20, 2006
1 parent e52c437 commit 89a86d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4f2928d0a439553f0288d9483faf417430629635
refs/heads/master: dcd0da002122a70fe1c625c0ca9f58c95aa33ebe
22 changes: 14 additions & 8 deletions trunk/lib/kobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@ int kobject_add(struct kobject * kobj)
unlink(kobj);
if (parent)
kobject_put(parent);

/* be noisy on error issues */
if (error == -EEXIST)
printk("kobject_add failed for %s with -EEXIST, "
"don't try to register things with the "
"same name in the same directory.\n",
kobject_name(kobj));
else
printk("kobject_add failed for %s (%d)\n",
kobject_name(kobj), error);
dump_stack();
}

return error;
Expand All @@ -207,18 +218,13 @@ int kobject_add(struct kobject * kobj)

int kobject_register(struct kobject * kobj)
{
int error = 0;
int error = -EINVAL;
if (kobj) {
kobject_init(kobj);
error = kobject_add(kobj);
if (error) {
printk("kobject_register failed for %s (%d)\n",
kobject_name(kobj),error);
dump_stack();
} else
if (!error)
kobject_uevent(kobj, KOBJ_ADD);
} else
error = -EINVAL;
}
return error;
}

Expand Down

0 comments on commit 89a86d7

Please sign in to comment.