aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kobject.h
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/kobject.h
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'include/linux/kobject.h')
-rw-r--r--include/linux/kobject.h44
1 files changed, 33 insertions, 11 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 939b11268c8..668729cc0fe 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -72,8 +72,8 @@ struct kobject {
72 unsigned int uevent_suppress:1; 72 unsigned int uevent_suppress:1;
73}; 73};
74 74
75extern __printf(2, 3) 75extern int kobject_set_name(struct kobject *kobj, const char *name, ...)
76int kobject_set_name(struct kobject *kobj, const char *name, ...); 76 __attribute__((format(printf, 2, 3)));
77extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, 77extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
78 va_list vargs); 78 va_list vargs);
79 79
@@ -83,13 +83,15 @@ static inline const char *kobject_name(const struct kobject *kobj)
83} 83}
84 84
85extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); 85extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
86extern __printf(3, 4) __must_check 86extern int __must_check kobject_add(struct kobject *kobj,
87int kobject_add(struct kobject *kobj, struct kobject *parent, 87 struct kobject *parent,
88 const char *fmt, ...); 88 const char *fmt, ...)
89extern __printf(4, 5) __must_check 89 __attribute__((format(printf, 3, 4)));
90int kobject_init_and_add(struct kobject *kobj, 90extern int __must_check kobject_init_and_add(struct kobject *kobj,
91 struct kobj_type *ktype, struct kobject *parent, 91 struct kobj_type *ktype,
92 const char *fmt, ...); 92 struct kobject *parent,
93 const char *fmt, ...)
94 __attribute__((format(printf, 4, 5)));
93 95
94extern void kobject_del(struct kobject *kobj); 96extern void kobject_del(struct kobject *kobj);
95 97
@@ -191,6 +193,8 @@ static inline struct kobj_type *get_ktype(struct kobject *kobj)
191} 193}
192 194
193extern struct kobject *kset_find_obj(struct kset *, const char *); 195extern struct kobject *kset_find_obj(struct kset *, const char *);
196extern struct kobject *kset_find_obj_hinted(struct kset *, const char *,
197 struct kobject *);
194 198
195/* The global /sys/kernel/ kobject for people to chain off of */ 199/* The global /sys/kernel/ kobject for people to chain off of */
196extern struct kobject *kernel_kobj; 200extern struct kobject *kernel_kobj;
@@ -203,14 +207,32 @@ extern struct kobject *power_kobj;
203/* The global /sys/firmware/ kobject for people to chain off of */ 207/* The global /sys/firmware/ kobject for people to chain off of */
204extern struct kobject *firmware_kobj; 208extern struct kobject *firmware_kobj;
205 209
210#if defined(CONFIG_HOTPLUG)
206int kobject_uevent(struct kobject *kobj, enum kobject_action action); 211int kobject_uevent(struct kobject *kobj, enum kobject_action action);
207int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, 212int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
208 char *envp[]); 213 char *envp[]);
209 214
210__printf(2, 3) 215int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
211int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); 216 __attribute__((format (printf, 2, 3)));
212 217
213int kobject_action_type(const char *buf, size_t count, 218int kobject_action_type(const char *buf, size_t count,
214 enum kobject_action *type); 219 enum kobject_action *type);
220#else
221static inline int kobject_uevent(struct kobject *kobj,
222 enum kobject_action action)
223{ return 0; }
224static inline int kobject_uevent_env(struct kobject *kobj,
225 enum kobject_action action,
226 char *envp[])
227{ return 0; }
228
229static inline __attribute__((format(printf, 2, 3)))
230int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
231{ return 0; }
232
233static inline int kobject_action_type(const char *buf, size_t count,
234 enum kobject_action *type)
235{ return -EINVAL; }
236#endif
215 237
216#endif /* _KOBJECT_H_ */ 238#endif /* _KOBJECT_H_ */