Commit 4856e09e authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://ldm.bkbits.net/linux-2.5-kobject

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 1baa95c5 b053262f
......@@ -355,7 +355,6 @@ static struct attribute * default_attrs[] = {
extern struct subsystem block_subsys;
static struct subsystem part_subsys = {
.kobj = { .name = "part" },
.parent = &block_subsys,
.default_attrs = default_attrs,
.sysfs_ops = &part_sysfs_ops,
......
......@@ -2,9 +2,10 @@
* kobject.c - library routines for handling generic kernel objects
*/
#define DEBUG 1
#define DEBUG 0
#include <linux/kobject.h>
#include <linux/string.h>
#include <linux/module.h>
#include <linux/stat.h>
......@@ -76,11 +77,13 @@ int kobject_register(struct kobject * kobj)
}
up_write(&s->rwsem);
}
error = sysfs_create_dir(kobj);
if (!error) {
error = kobject_populate_dir(kobj);
if (error)
sysfs_remove_dir(kobj);
if (strlen(kobj->name)) {
error = sysfs_create_dir(kobj);
if (!error) {
error = kobject_populate_dir(kobj);
if (error)
sysfs_remove_dir(kobj);
}
}
return error;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment