Messages in this thread Patch in this message | | | Date | Wed, 18 Oct 2000 22:03:34 -0700 | From | Greg KH <> | Subject | [PATCH] usb-core.c removal |
| |
Hi,
Here's the patch that removes usb-core.c and moves its functions into usb.c. It's against 2.4.0-test10-pre4.
This should solve the versioned modules with a USB core compiled into the kernel problem that people were having.
Thanks,
greg k-h
-- greg@(kroah|wirex).com diff -Naur -X dontdiff linux-2.4.0-test10-pre4/drivers/usb/Makefile linux-2.4.0-test10-pre4-greg/drivers/usb/Makefile --- linux-2.4.0-test10-pre4/drivers/usb/Makefile Tue Oct 3 23:44:23 2000 +++ linux-2.4.0-test10-pre4-greg/drivers/usb/Makefile Wed Oct 18 21:56:43 2000 @@ -21,7 +21,7 @@ # Multipart objects. list-multi := usbcore.o -usbcore-objs := usb.o usb-debug.o usb-core.o hub.o +usbcore-objs := usb.o usb-debug.o hub.o # Optional parts of multipart objects. diff -Naur -X dontdiff linux-2.4.0-test10-pre4/drivers/usb/usb-core.c linux-2.4.0-test10-pre4-greg/drivers/usb/usb-core.c --- linux-2.4.0-test10-pre4/drivers/usb/usb-core.c Tue Oct 3 23:44:24 2000 +++ linux-2.4.0-test10-pre4-greg/drivers/usb/usb-core.c Wed Dec 31 16:00:00 1969 @@ -1,53 +0,0 @@ -/* - * driver/usb/usb-core.c - * - * (C) Copyright David Waite 1999 - * based on code from usb.c, by Linus Torvalds - * - * The purpose of this file is to pull any and all generic modular code from - * usb.c and put it in a separate file. This way usb.c is kept as a generic - * library, while this file handles starting drivers, etc. - * - */ - -#include <linux/version.h> -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/usb.h> - -/* - * USB core - */ - -int usb_hub_init(void); -void usb_hub_cleanup(void); -int usb_major_init(void); -void usb_major_cleanup(void); - - -/* - * Cleanup - */ - -static void __exit usb_exit(void) -{ - usb_major_cleanup(); - usbdevfs_cleanup(); - usb_hub_cleanup(); -} - -/* - * Init - */ - -static int __init usb_init(void) -{ - usb_major_init(); - usbdevfs_init(); - usb_hub_init(); - - return 0; -} - -module_init(usb_init); -module_exit(usb_exit); diff -Naur -X dontdiff linux-2.4.0-test10-pre4/drivers/usb/usb.c linux-2.4.0-test10-pre4-greg/drivers/usb/usb.c --- linux-2.4.0-test10-pre4/drivers/usb/usb.c Tue Oct 3 23:44:24 2000 +++ linux-2.4.0-test10-pre4-greg/drivers/usb/usb.c Wed Oct 18 21:58:32 2000 @@ -26,6 +26,7 @@ #include <linux/malloc.h> #include <linux/interrupt.h> /* for in_interrupt() */ #include <linux/kmod.h> +#include <linux/init.h> #ifdef CONFIG_USB_DEBUG @@ -47,6 +48,9 @@ 0; #endif +extern int usb_hub_init(void); +extern void usb_hub_cleanup(void); + /* * Prototypes for the device driver probing/loading functions */ @@ -2028,6 +2032,32 @@ return &usb_bus_list; } #endif + + +/* + * Init + */ +static int __init usb_init(void) +{ + usb_major_init(); + usbdevfs_init(); + usb_hub_init(); + + return 0; +} + +/* + * Cleanup + */ +static void __exit usb_exit(void) +{ + usb_major_cleanup(); + usbdevfs_cleanup(); + usb_hub_cleanup(); +} + +module_init(usb_init); +module_exit(usb_exit); /* * USB may be built into the kernel or be built as modules.[unhandled content-type:application/pgp-signature] | |