aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject_uevent.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2006-04-25 09:37:26 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-04-27 16:08:56 -0400
commit4d17ffda331ba6030bb8c233c73d6a87954d8ea7 (patch)
tree3de71893233afa664ad6419e37a02da7ccef327f /lib/kobject_uevent.c
parent913e7ec545462b9a49fa308d0c81697236f7d29d (diff)
[PATCH] Kobject: fix build error
This fixes a build error for various odd combinations of CONFIG_HOTPLUG and CONFIG_NET. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Cc: Nigel Cunningham <ncunningham@cyclades.com> Cc: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'lib/kobject_uevent.c')
-rw-r--r--lib/kobject_uevent.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 982226daf939..7f20e7b857cb 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -25,11 +25,13 @@
25#define BUFFER_SIZE 2048 /* buffer for the variables */ 25#define BUFFER_SIZE 2048 /* buffer for the variables */
26#define NUM_ENVP 32 /* number of env pointers */ 26#define NUM_ENVP 32 /* number of env pointers */
27 27
28#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 28#if defined(CONFIG_HOTPLUG)
29u64 uevent_seqnum; 29u64 uevent_seqnum;
30char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug"; 30char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug";
31static DEFINE_SPINLOCK(sequence_lock); 31static DEFINE_SPINLOCK(sequence_lock);
32#if defined(CONFIG_NET)
32static struct sock *uevent_sock; 33static struct sock *uevent_sock;
34#endif
33 35
34static char *action_to_string(enum kobject_action action) 36static char *action_to_string(enum kobject_action action)
35{ 37{
@@ -155,6 +157,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action)
155 spin_unlock(&sequence_lock); 157 spin_unlock(&sequence_lock);
156 sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq); 158 sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);
157 159
160#if defined(CONFIG_NET)
158 /* send netlink message */ 161 /* send netlink message */
159 if (uevent_sock) { 162 if (uevent_sock) {
160 struct sk_buff *skb; 163 struct sk_buff *skb;
@@ -179,6 +182,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action)
179 netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL); 182 netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL);
180 } 183 }
181 } 184 }
185#endif
182 186
183 /* call uevent_helper, usually only enabled during early boot */ 187 /* call uevent_helper, usually only enabled during early boot */
184 if (uevent_helper[0]) { 188 if (uevent_helper[0]) {
@@ -249,6 +253,7 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index,
249} 253}
250EXPORT_SYMBOL_GPL(add_uevent_var); 254EXPORT_SYMBOL_GPL(add_uevent_var);
251 255
256#if defined(CONFIG_NET)
252static int __init kobject_uevent_init(void) 257static int __init kobject_uevent_init(void)
253{ 258{
254 uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL, 259 uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL,
@@ -264,5 +269,6 @@ static int __init kobject_uevent_init(void)
264} 269}
265 270
266postcore_initcall(kobject_uevent_init); 271postcore_initcall(kobject_uevent_init);
272#endif
267 273
268#endif /* CONFIG_HOTPLUG */ 274#endif /* CONFIG_HOTPLUG */