aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/kobject.h')
-rw-r--r--include/linux/kobject.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index e2b8c3dae425..5031565ab30d 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -135,7 +135,6 @@ struct kset_uevent_ops {
135 * define the attribute callbacks and other common events that happen to 135 * define the attribute callbacks and other common events that happen to
136 * a kobject. 136 * a kobject.
137 * 137 *
138 * @ktype: the struct kobj_type for this specific kset
139 * @list: the list of all kobjects for this kset 138 * @list: the list of all kobjects for this kset
140 * @list_lock: a lock for iterating over the kobjects 139 * @list_lock: a lock for iterating over the kobjects
141 * @kobj: the embedded kobject for this kset (recursion, isn't it fun...) 140 * @kobj: the embedded kobject for this kset (recursion, isn't it fun...)
@@ -145,7 +144,6 @@ struct kset_uevent_ops {
145 * desired. 144 * desired.
146 */ 145 */
147struct kset { 146struct kset {
148 struct kobj_type *ktype;
149 struct list_head list; 147 struct list_head list;
150 spinlock_t list_lock; 148 spinlock_t list_lock;
151 struct kobject kobj; 149 struct kobject kobj;
@@ -173,12 +171,9 @@ static inline void kset_put(struct kset * k)
173 kobject_put(&k->kobj); 171 kobject_put(&k->kobj);
174} 172}
175 173
176static inline struct kobj_type * get_ktype(struct kobject * k) 174static inline struct kobj_type *get_ktype(struct kobject *kobj)
177{ 175{
178 if (k->kset && k->kset->ktype) 176 return kobj->ktype;
179 return k->kset->ktype;
180 else
181 return k->ktype;
182} 177}
183 178
184extern struct kobject * kset_find_obj(struct kset *, const char *); 179extern struct kobject * kset_find_obj(struct kset *, const char *);
@@ -191,16 +186,14 @@ extern struct kobject * kset_find_obj(struct kset *, const char *);
191#define set_kset_name(str) .kset = { .kobj = { .k_name = str } } 186#define set_kset_name(str) .kset = { .kobj = { .k_name = str } }
192 187
193 188
194#define decl_subsys(_name,_type,_uevent_ops) \ 189#define decl_subsys(_name,_uevent_ops) \
195struct kset _name##_subsys = { \ 190struct kset _name##_subsys = { \
196 .kobj = { .k_name = __stringify(_name) }, \ 191 .kobj = { .k_name = __stringify(_name) }, \
197 .ktype = _type, \
198 .uevent_ops =_uevent_ops, \ 192 .uevent_ops =_uevent_ops, \
199} 193}
200#define decl_subsys_name(_varname,_name,_type,_uevent_ops) \ 194#define decl_subsys_name(_varname,_name,_uevent_ops) \
201struct kset _varname##_subsys = { \ 195struct kset _varname##_subsys = { \
202 .kobj = { .k_name = __stringify(_name) }, \ 196 .kobj = { .k_name = __stringify(_name) }, \
203 .ktype = _type, \
204 .uevent_ops =_uevent_ops, \ 197 .uevent_ops =_uevent_ops, \
205} 198}
206 199