From: Hannes Reinecke <hare@suse.de>

Currently most driver events are not sent out when using initramfs as
driver_init() (which triggers the events) is called before init_workqueues.

This patch rearranges the init calls so that the hotplug event queue is
enabled prior to calling driver_init(), hence we're getting all hotplug
events again.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/init/main.c   |    6 +++++-
 25-akpm/kernel/kmod.c |    4 +---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff -puN init/main.c~enable-all-events-for-initramfs init/main.c
--- 25/init/main.c~enable-all-events-for-initramfs	2004-07-26 14:34:07.427604248 -0700
+++ 25-akpm/init/main.c	2004-07-26 14:34:07.433603336 -0700
@@ -93,6 +93,7 @@ extern void free_initmem(void);
 extern void populate_rootfs(void);
 extern void driver_init(void);
 extern void prepare_namespace(void);
+extern void usermodehelper_init(void);
 
 #ifdef CONFIG_TC
 extern void tc_init(void);
@@ -630,6 +631,10 @@ static void __init do_initcalls(void)
  */
 static void __init do_basic_setup(void)
 {
+	/* drivers will send hotplug events */
+	init_workqueues();
+	usermodehelper_init();
+
 	driver_init();
 
 #ifdef CONFIG_SYSCTL
@@ -639,7 +644,6 @@ static void __init do_basic_setup(void)
 	/* Networking initialization needs a process context */ 
 	sock_init();
 
-	init_workqueues();
 	do_initcalls();
 }
 
diff -puN kernel/kmod.c~enable-all-events-for-initramfs kernel/kmod.c
--- 25/kernel/kmod.c~enable-all-events-for-initramfs	2004-07-26 14:34:07.429603944 -0700
+++ 25-akpm/kernel/kmod.c	2004-07-26 14:34:07.433603336 -0700
@@ -272,10 +272,8 @@ int call_usermodehelper(char *path, char
 }
 EXPORT_SYMBOL(call_usermodehelper);
 
-static __init int usermodehelper_init(void)
+void __init usermodehelper_init(void)
 {
 	khelper_wq = create_singlethread_workqueue("khelper");
 	BUG_ON(!khelper_wq);
-	return 0;
 }
-core_initcall(usermodehelper_init);
_