From 5489bd0abf6c1a29108096ca39249b597e186c2a Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Tue, 25 Apr 2006 15:37:26 +0200 Subject: [PATCH] --- yaml --- r: 26239 b: refs/heads/master c: 4d17ffda331ba6030bb8c233c73d6a87954d8ea7 h: refs/heads/master i: 26237: f2ff0bdf13f1a7b898491114f8d8f0daf394555c 26235: 07201ff7403b643acc071f32600544a0b42f4f54 26231: 2220d24627e9e99f7bbd18c5959a5008e0d44aca 26223: a032057ae4e03110960a8da4d8c49ef2c7106148 26207: bcbc8fb10542c4f18cffed366c3dcee7c3161446 26175: 9db4168695598cf903a2af173e86e9c1cb978112 26111: ef1a864e7138f7257cc05fe660d4533b3ee3997b v: v3 --- [refs] | 2 +- trunk/include/linux/kobject.h | 2 +- trunk/lib/kobject_uevent.c | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index f91359ae8021..56bfdf23f4fc 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 913e7ec545462b9a49fa308d0c81697236f7d29d +refs/heads/master: 4d17ffda331ba6030bb8c233c73d6a87954d8ea7 diff --git a/trunk/include/linux/kobject.h b/trunk/include/linux/kobject.h index dcd0623be892..e38bb357282a 100644 --- a/trunk/include/linux/kobject.h +++ b/trunk/include/linux/kobject.h @@ -259,7 +259,7 @@ struct subsys_attribute { extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); -#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) +#if defined(CONFIG_HOTPLUG) void kobject_uevent(struct kobject *kobj, enum kobject_action action); int add_uevent_var(char **envp, int num_envp, int *cur_index, diff --git a/trunk/lib/kobject_uevent.c b/trunk/lib/kobject_uevent.c index 982226daf939..7f20e7b857cb 100644 --- a/trunk/lib/kobject_uevent.c +++ b/trunk/lib/kobject_uevent.c @@ -25,11 +25,13 @@ #define BUFFER_SIZE 2048 /* buffer for the variables */ #define NUM_ENVP 32 /* number of env pointers */ -#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) +#if defined(CONFIG_HOTPLUG) u64 uevent_seqnum; char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug"; static DEFINE_SPINLOCK(sequence_lock); +#if defined(CONFIG_NET) static struct sock *uevent_sock; +#endif static char *action_to_string(enum kobject_action action) { @@ -155,6 +157,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action) spin_unlock(&sequence_lock); sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq); +#if defined(CONFIG_NET) /* send netlink message */ if (uevent_sock) { struct sk_buff *skb; @@ -179,6 +182,7 @@ void kobject_uevent(struct kobject *kobj, enum kobject_action action) netlink_broadcast(uevent_sock, skb, 0, 1, GFP_KERNEL); } } +#endif /* call uevent_helper, usually only enabled during early boot */ if (uevent_helper[0]) { @@ -249,6 +253,7 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index, } EXPORT_SYMBOL_GPL(add_uevent_var); +#if defined(CONFIG_NET) static int __init kobject_uevent_init(void) { uevent_sock = netlink_kernel_create(NETLINK_KOBJECT_UEVENT, 1, NULL, @@ -264,5 +269,6 @@ static int __init kobject_uevent_init(void) } postcore_initcall(kobject_uevent_init); +#endif #endif /* CONFIG_HOTPLUG */