summaryrefslogtreecommitdiff
path: root/include/linux/kobject.h
diff options
context:
space:
mode:
authorRoland Dreier <roland@topspin.com>2004-09-29 03:24:36 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2004-09-29 03:24:36 -0700
commite2661e66605c57210ea9e689b51fc63ac001c8b3 (patch)
tree6b505138a674f09229e20729a2d4cb7eebd543a8 /include/linux/kobject.h
parente0dff4c88eb8c627cb9c34ad3a2e0eafae4f0165 (diff)
[PATCH] kobject: add add_hotplug_env_var()
Add a (non-inlined) add_hotplug_env_var() function to <linux/kobject.h> and lib/kobject.c. There's a lot of boilerplate code involved in setting environment variables in a hotplug method, so we should have a convenience function to consolidate it (and avoid subtle bugs). Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'include/linux/kobject.h')
-rw-r--r--include/linux/kobject.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 157ce2cc1642..187ac79e1f17 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -237,9 +237,17 @@ extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
#ifdef CONFIG_HOTPLUG
-extern void kobject_hotplug(struct kobject *kobj, enum kobject_action action);
+void kobject_hotplug(struct kobject *kobj, enum kobject_action action);
+int add_hotplug_env_var(char **envp, int num_envp, int *cur_index,
+ char *buffer, int buffer_size, int *cur_len,
+ const char *format, ...)
+ __attribute__((format (printf, 7, 8)));
#else
static inline void kobject_hotplug(struct kobject *kobj, enum kobject_action action) { }
+static inline int add_hotplug_env_var(char **envp, int num_envp, int *cur_index,
+ char *buffer, int buffer_size, int *cur_len,
+ const char *format, ...)
+{ return 0; }
#endif
#endif /* __KERNEL__ */