Import 2.3.4pre3
[davej-history.git] / drivers / usb / usb-core.c
blob637736e813c02382020ad4543991d3953dd5e95b
1 /*
2 * driver/usb/usb-core.c
4 * (C) Copyright David Waite 1999
5 * based on code from usb.c, by Linus Torvolds
7 * The purpose of this file is to pull any and all generic modular code from
8 * usb.c and put it in a separate file. This way usb.c is kept as a generic
9 * library, while this file handles starting drivers, etc.
12 #include <linux/kernel.h>
13 #include <linux/config.h>
14 #include <linux/module.h>
16 #include "inits.h"
17 #include "usb.h"
19 #ifndef CONFIG_USB_MODULE
20 # ifdef CONFIG_USB_UHCI
21 int uhci_init(void);
22 # endif
23 # ifdef CONFIG_USB_OHCI
24 int ohci_init(void);
25 # endif
26 # ifdef CONFIG_USB_OHCI_HCD
27 int ohci_hcd_init(void);
28 # endif
29 #endif
31 int usb_init(void)
33 #ifndef CONFIG_USB_MODULE
34 # ifdef CONFIG_USB_UHCI
35 uhci_init();
36 # endif
37 # ifdef CONFIG_USB_OHCI
38 ohci_init();
39 # endif
40 # ifdef CONFIG_USB_OHCI_HCD
41 ohci_hcd_init();
42 # endif
43 # ifdef CONFIG_USB_MOUSE
44 usb_mouse_init();
45 # endif
46 # ifdef CONFIG_USB_KBD
47 usb_kbd_init();
48 # endif
49 # ifdef CONFIG_USB_AUDIO
50 usb_audio_init();
51 # endif
52 # ifdef CONFIG_USB_ACM
53 usb_acm_init();
54 # endif
55 # ifdef CONFIG_USB_PRINTER
56 usb_print_init();
57 # endif
58 # ifdef CONFIG_USB_CPIA
59 usb_cpia_init();
60 # endif
61 # ifdef CONFIG_USB_HUB
62 usb_hub_init();
63 # endif
64 #endif
65 return 0;
68 * Clean up when unloading the module
70 void cleanup_drivers(void)
72 #ifndef MODULE
73 # ifdef CONFIG_USB_HUB
74 usb_hub_cleanup();
75 # endif
76 # ifdef CONFIG_USB_MOUSE
77 usb_mouse_cleanup();
78 # endif
79 #endif
82 #ifdef MODULE
83 int init_module(void)
85 return usb_init();
87 void module_cleanup(void)
89 cleanup_drivers();
91 #endif