diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-09-27 17:48:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:10 -0500 |
commit | b727c702896f88d2ff6c3e03bd011d7c3dffe3e1 (patch) | |
tree | 772f0a3eb78a3e1d3475d36356bbff715a907829 /include/linux/kobject.h | |
parent | 12d03da7c19366268bdbc9fb0cd08d719c0cc283 (diff) |
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>
Diffstat (limited to 'include/linux/kobject.h')
-rw-r--r-- | include/linux/kobject.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 0b97b3a53917..f91aeb745664 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -150,11 +150,13 @@ struct kset { | |||
150 | struct kset_uevent_ops *uevent_ops; | 150 | struct kset_uevent_ops *uevent_ops; |
151 | }; | 151 | }; |
152 | 152 | ||
153 | |||
154 | extern void kset_init(struct kset * k); | 153 | extern void kset_init(struct kset * k); |
155 | extern int __must_check kset_add(struct kset * k); | 154 | extern int __must_check kset_add(struct kset * k); |
156 | extern int __must_check kset_register(struct kset * k); | 155 | extern int __must_check kset_register(struct kset * k); |
157 | extern void kset_unregister(struct kset * k); | 156 | extern void kset_unregister(struct kset * k); |
157 | extern struct kset * __must_check kset_create_and_add(const char *name, | ||
158 | struct kset_uevent_ops *u, | ||
159 | struct kobject *parent_kobj); | ||
158 | 160 | ||
159 | static inline struct kset * to_kset(struct kobject * kobj) | 161 | static inline struct kset * to_kset(struct kobject * kobj) |
160 | { | 162 | { |