aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject_uevent.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 13:47:26 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 13:47:26 -0500
commitf0cd91a68acdc9b49d7f6738b514a426da627649 (patch)
tree8ad73564015794197583b094217ae0a71e71e753 /lib/kobject_uevent.c
parent[SCSI] spi transport: don't allow dt to be set on SE or HVD buses (diff)
parentMerge branch 'upstream-fixes' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6 (diff)
downloadlinux-dev-f0cd91a68acdc9b49d7f6738b514a426da627649.tar.xz
linux-dev-f0cd91a68acdc9b49d7f6738b514a426da627649.zip
Merge ../linux-2.6
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 @@
#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 */