mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
kset: add kset_create_and_add function
Now ksets can be dynamically created on the fly, no static definitions are required. Thanks to Miklos for hints on how to make this work better for the callers. And thanks to Kay for finding some stupid bugs in my original version and pointing out that we need to handle the fact that kobject's can have a kset as a parent and to handle that properly in kobject_add(). Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
12d03da7c1
commit
b727c70289
2 changed files with 94 additions and 2 deletions
|
@ -150,11 +150,13 @@ struct kset {
|
|||
struct kset_uevent_ops *uevent_ops;
|
||||
};
|
||||
|
||||
|
||||
extern void kset_init(struct kset * k);
|
||||
extern int __must_check kset_add(struct kset * k);
|
||||
extern int __must_check kset_register(struct kset * k);
|
||||
extern void kset_unregister(struct kset * k);
|
||||
extern struct kset * __must_check kset_create_and_add(const char *name,
|
||||
struct kset_uevent_ops *u,
|
||||
struct kobject *parent_kobj);
|
||||
|
||||
static inline struct kset * to_kset(struct kobject * kobj)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue