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[] = { ...@@ -355,7 +355,6 @@ static struct attribute * default_attrs[] = {
extern struct subsystem block_subsys; extern struct subsystem block_subsys;
static struct subsystem part_subsys = { static struct subsystem part_subsys = {
.kobj = { .name = "part" },
.parent = &block_subsys, .parent = &block_subsys,
.default_attrs = default_attrs, .default_attrs = default_attrs,
.sysfs_ops = &part_sysfs_ops, .sysfs_ops = &part_sysfs_ops,
......
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
* kobject.c - library routines for handling generic kernel objects * kobject.c - library routines for handling generic kernel objects
*/ */
#define DEBUG 1 #define DEBUG 0
#include <linux/kobject.h> #include <linux/kobject.h>
#include <linux/string.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/stat.h> #include <linux/stat.h>
...@@ -76,11 +77,13 @@ int kobject_register(struct kobject * kobj) ...@@ -76,11 +77,13 @@ int kobject_register(struct kobject * kobj)
} }
up_write(&s->rwsem); up_write(&s->rwsem);
} }
error = sysfs_create_dir(kobj); if (strlen(kobj->name)) {
if (!error) { error = sysfs_create_dir(kobj);
error = kobject_populate_dir(kobj); if (!error) {
if (error) error = kobject_populate_dir(kobj);
sysfs_remove_dir(kobj); if (error)
sysfs_remove_dir(kobj);
}
} }
return error; 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