summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2004-10-31 21:06:49 -0800
committerGreg Kroah-Hartman <greg@kroah.com>2004-10-31 21:06:49 -0800
commit6f1780569c67765e1fef8754fc1812714b85e4d0 (patch)
treec47aa542f4209b1349131263bc10f222a64d23b5
parente07d4e6100616189478dda62e0a261760f2cf4ff (diff)
[PATCH] take me home, hotplug_path[]
Move hotplug_path[] out of kmod.[ch] to kobject_uevent.[ch] where it belongs now. At some time in the future we should fix the remaining bad hotplug calls (no SEQNUM, no netlink uevent): ./drivers/input/input.c (no DEVPATH on some hotplug events!) ./drivers/pnp/pnpbios/core.c ./drivers/s390/crypto/z90main.c Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
-rw-r--r--drivers/input/input.c2
-rw-r--r--drivers/pnp/pnpbios/core.c2
-rw-r--r--drivers/s390/crypto/z90main.c1
-rw-r--r--include/linux/kmod.h4
-rw-r--r--include/linux/kobject_uevent.h5
-rw-r--r--kernel/cpu.c1
-rw-r--r--kernel/kmod.c23
-rw-r--r--kernel/sysctl.c2
-rw-r--r--lib/kobject_uevent.c1
9 files changed, 10 insertions, 31 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 416084b8065a..2fdb2092ffb0 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -19,7 +19,7 @@
#include <linux/major.h>
#include <linux/pm.h>
#include <linux/proc_fs.h>
-#include <linux/kmod.h>
+#include <linux/kobject_uevent.h>
#include <linux/interrupt.h>
#include <linux/poll.h>
#include <linux/device.h>
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
index ba5d1cbaea96..6edeee967dee 100644
--- a/drivers/pnp/pnpbios/core.c
+++ b/drivers/pnp/pnpbios/core.c
@@ -56,7 +56,7 @@
#include <linux/mm.h>
#include <linux/smp.h>
#include <linux/slab.h>
-#include <linux/kmod.h>
+#include <linux/kobject_uevent.h>
#include <linux/completion.h>
#include <linux/spinlock.h>
#include <linux/dmi.h>
diff --git a/drivers/s390/crypto/z90main.c b/drivers/s390/crypto/z90main.c
index f9a90df78f33..6346ccd78c39 100644
--- a/drivers/s390/crypto/z90main.c
+++ b/drivers/s390/crypto/z90main.c
@@ -33,6 +33,7 @@
#include <linux/ioctl32.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
+#include <linux/kobject_uevent.h>
#include <linux/proc_fs.h>
#include <linux/syscalls.h>
#include <linux/version.h>
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 588f4c6ebe29..95d0e4b0814d 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -37,8 +37,4 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait);
extern void usermodehelper_init(void);
-#ifdef CONFIG_HOTPLUG
-extern char hotplug_path [];
-#endif
-
#endif /* __LINUX_KMOD_H__ */
diff --git a/include/linux/kobject_uevent.h b/include/linux/kobject_uevent.h
index 7292821f7fd7..91405f7300a1 100644
--- a/include/linux/kobject_uevent.h
+++ b/include/linux/kobject_uevent.h
@@ -11,6 +11,11 @@
#ifndef _KOBJECT_EVENT_H_
#define _KOBJECT_EVENT_H_
+#define HOTPLUG_PATH_LEN 256
+
+/* path to the hotplug userspace helper executed on an event */
+extern char hotplug_path[];
+
/*
* If you add an action here, you must also add the proper string to the
* lib/kobject_uevent.c file.
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 52fdf97749a2..ebaba873ebad 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -11,7 +11,6 @@
#include <linux/unistd.h>
#include <linux/cpu.h>
#include <linux/module.h>
-#include <linux/kmod.h> /* for hotplug_path */
#include <linux/kthread.h>
#include <linux/stop_machine.h>
#include <asm/semaphore.h>
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 5e7c44a0cbaa..eed53d4f5230 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -115,29 +115,6 @@ int request_module(const char *fmt, ...)
EXPORT_SYMBOL(request_module);
#endif /* CONFIG_KMOD */
-#ifdef CONFIG_HOTPLUG
-/*
- hotplug path is set via /proc/sys
- invoked by hotplug-aware bus drivers,
- with call_usermodehelper
-
- argv [0] = hotplug_path;
- argv [1] = "usb", "scsi", "pci", "network", etc;
- ... plus optional type-specific parameters
- argv [n] = 0;
-
- envp [*] = HOME, PATH; optional type-specific parameters
-
- a hotplug bus should invoke this for device add/remove
- events. the command is expected to load drivers when
- necessary, and may perform additional system setup.
-*/
-char hotplug_path[KMOD_PATH_LEN] = "/sbin/hotplug";
-
-EXPORT_SYMBOL(hotplug_path);
-
-#endif /* CONFIG_HOTPLUG */
-
struct subprocess_info {
struct completion *complete;
char *path;
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 67ffac304262..8b40136f15d0 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -394,7 +394,7 @@ static ctl_table kern_table[] = {
.ctl_name = KERN_HOTPLUG,
.procname = "hotplug",
.data = &hotplug_path,
- .maxlen = KMOD_PATH_LEN,
+ .maxlen = HOTPLUG_PATH_LEN,
.mode = 0644,
.proc_handler = &proc_dostring,
.strategy = &sysctl_string,
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index f352f3770419..c372e4767383 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -177,6 +177,7 @@ static inline int send_uevent(const char *signal, const char *obj,
#ifdef CONFIG_HOTPLUG
+char hotplug_path[HOTPLUG_PATH_LEN] = "/sbin/hotplug";
u64 hotplug_seqnum;
static spinlock_t sequence_lock = SPIN_LOCK_UNLOCKED;