kobject: add kobject_init_and_add function

Also add a kobject_init_and_add function which bundles up what a lot of
the current callers want to do all at once, and it properly handles the
memory usages, unlike kobject_register();

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Greg Kroah-Hartman 2007-12-03 21:31:08 -08:00
parent 244f6cee9a
commit c11c4154e7
2 changed files with 32 additions and 0 deletions

View file

@ -84,6 +84,11 @@ extern int __must_check kobject_add(struct kobject *);
extern int __must_check kobject_add_ng(struct kobject *kobj,
struct kobject *parent,
const char *fmt, ...);
extern int __must_check kobject_init_and_add(struct kobject *kobj,
struct kobj_type *ktype,
struct kobject *parent,
const char *fmt, ...);
extern void kobject_del(struct kobject *);
extern int __must_check kobject_rename(struct kobject *, const char *new_name);