Linus,

Here is a patch which removes the usb_init call from init/main.c
It is against 2.4.0-test7-pre3.

thanks,

greg k-h
(temporary USB maintainer)

-- 
greg@(kroah|wirex).com
diff -Naur -X dontdiff linux-2.4.0-test7-pre3/drivers/usb/Makefile 
linux-2.4.0-test7-pre3-greg/drivers/usb/Makefile
--- linux-2.4.0-test7-pre3/drivers/usb/Makefile Wed Aug  9 22:28:57 2000
+++ linux-2.4.0-test7-pre3-greg/drivers/usb/Makefile    Sun Aug 13 16:23:14 2000
@@ -19,6 +19,10 @@
 
 export-objs            := usb.o input.o
 
+# Objects which appear many times
+
+common-objs    := input.o
+
 # Multipart objects.
 
 list-multi             := usbcore.o
@@ -37,27 +41,6 @@
 obj-n  :=
 obj-   :=
 
-# Object files in subdirectories
-
-ifeq ($(CONFIG_USB_SERIAL),y)
-       SUB_DIRS += serial
-       obj-y += serial/usb-serial.o
-else
-       ifeq ($(CONFIG_USB_SERIAL),m)
-               MOD_IN_SUB_DIRS += serial
-       endif
-endif
-
-ifeq ($(CONFIG_USB_STORAGE),y)
-       SUB_DIRS += storage
-       obj-y += storage/usb-storage.o
-else
-       ifeq ($(CONFIG_USB_STORAGE),m)
-               MOD_IN_SUB_DIRS += storage
-       endif
-endif
-
-
 # Each configuration option enables a list of files.
 
 obj-$(CONFIG_USB)              += usbcore.o
@@ -92,6 +75,33 @@
 obj-$(CONFIG_USB_MICROTEK)     += microtek.o
 obj-$(CONFIG_USB_BLUETOOTH)    += bluetooth.o
 
+# Object files in subdirectories
+
+ifeq ($(CONFIG_USB_SERIAL),y)
+       SUB_DIRS += serial
+       obj-y += serial/usb-serial.o
+else
+       ifeq ($(CONFIG_USB_SERIAL),m)
+               MOD_IN_SUB_DIRS += serial
+       endif
+endif
+
+ifeq ($(CONFIG_USB_STORAGE),y)
+       SUB_DIRS += storage
+       obj-y += storage/usb-storage.o
+else
+       ifeq ($(CONFIG_USB_STORAGE),m)
+               MOD_IN_SUB_DIRS += storage
+       endif
+endif
+
+# Remove duplicates.
+# The 'common-*' lists are intermediate lists used to filter out
+# duplicates.
+
+common-y       := $(filter $(obj-y),$(common-obj))
+obj-y          := $(filter-out $(common-y), $(obj-y)) $(common-y)
+
 # Extract lists of the multi-part drivers.
 # The 'int-*' lists are the intermediate files used to build the multi's.
 
@@ -111,8 +121,8 @@
 
 # Translate to Rules.make lists.
 
-O_OBJS         := $(sort $(filter-out $(export-objs), $(obj-y)))
-OX_OBJS                := $(sort $(filter     $(export-objs), $(obj-y)))
+O_OBJS         := $(filter-out $(export-objs), $(obj-y))
+OX_OBJS                := $(filter     $(export-objs), $(obj-y))
 M_OBJS         := $(sort $(filter-out $(export-objs), $(obj-m)))
 MX_OBJS                := $(sort $(filter     $(export-objs), $(obj-m)))
 MI_OBJS                := $(sort $(filter-out $(export-objs), $(int-m)))
diff -Naur -X dontdiff linux-2.4.0-test7-pre3/drivers/usb/usb-core.c 
linux-2.4.0-test7-pre3-greg/drivers/usb/usb-core.c
--- linux-2.4.0-test7-pre3/drivers/usb/usb-core.c       Wed Aug  9 21:40:07 2000
+++ linux-2.4.0-test7-pre3-greg/drivers/usb/usb-core.c  Sun Aug 13 16:23:14 2000
@@ -13,6 +13,7 @@
 #include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/config.h>
+#include <linux/init.h>
 #include <linux/usb.h>
 
 /*
@@ -42,13 +43,11 @@
 int uhci_init(void);
 int ohci_hcd_init(void);
 
-#ifdef MODULE
-
 /*
  * Cleanup
  */
 
-void cleanup_module(void)
+static void __exit usb_exit(void)
 {
        usb_major_cleanup();
        usbdevfs_cleanup();
@@ -59,10 +58,7 @@
  * Init
  */
 
-int init_module(void)
-#else
-int usb_init(void)
-#endif
+static int __init usb_init(void)
 {
        usb_major_init();
        usbdevfs_init();
@@ -99,3 +95,6 @@
 #endif
        return 0;
 }
+
+module_init(usb_init);
+module_exit(usb_exit);
diff -Naur -X dontdiff linux-2.4.0-test7-pre3/init/main.c 
linux-2.4.0-test7-pre3-greg/init/main.c
--- linux-2.4.0-test7-pre3/init/main.c  Sun Aug 13 14:49:51 2000
+++ linux-2.4.0-test7-pre3-greg/init/main.c     Sun Aug 13 16:34:43 2000
@@ -95,7 +95,6 @@
 extern void signals_init(void);
 extern void bdev_init(void);
 extern int init_pcmcia_ds(void);
-extern int usb_init(void);
 
 extern void free_initmem(void);
 extern void filesystem_setup(void);
@@ -685,10 +684,6 @@
 #endif
 #ifdef CONFIG_ISAPNP
        isapnp_init();
-#endif
-#ifdef CONFIG_USB
-       usb_init();     /* Do this before doing initcalls, so that we can make
-                       usbcore initialize here, and all drivers initialize later */
 #endif
 #ifdef CONFIG_TC
        tc_init();

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to