diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 4fec0e8ee000efd6cfe22b4e31aaef61adc75c2d..5c4a1330b4985e0238d92335ce3767f345bfc8fc 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -5,7 +5,8 @@ ccflags-$(CONFIG_USB_GADGET_DEBUG) := -DDEBUG obj-$(CONFIG_USB_GADGET) += udc-core.o obj-$(CONFIG_USB_LIBCOMPOSITE) += libcomposite.o -libcomposite-y := usbstring.o config.o epautoconf.o gadget_chips.o +libcomposite-y := usbstring.o config.o epautoconf.o +libcomposite-y += gadget_chips.o composite.o obj-$(CONFIG_USB_DUMMY_HCD) += dummy_hcd.o obj-$(CONFIG_USB_NET2272) += net2272.o obj-$(CONFIG_USB_NET2280) += net2280.o diff --git a/drivers/usb/gadget/acm_ms.c b/drivers/usb/gadget/acm_ms.c index d280f164887c531e9fdc3dff24ac64e9a715e134..b0abc2518b38d82de6f1f64909793f32a91d391f 100644 --- a/drivers/usb/gadget/acm_ms.c +++ b/drivers/usb/gadget/acm_ms.c @@ -15,6 +15,7 @@ */ #include +#include #include "u_serial.h" @@ -40,7 +41,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" #include "u_serial.c" #include "f_acm.c" #include "f_mass_storage.c" diff --git a/drivers/usb/gadget/audio.c b/drivers/usb/gadget/audio.c index 1f81e0f4fab928bb20308b6e3cb94f1d0d0a1654..1b9dee91d68694e9b2d4995c2fc1068aa75cfe22 100644 --- a/drivers/usb/gadget/audio.c +++ b/drivers/usb/gadget/audio.c @@ -12,22 +12,13 @@ /* #define VERBOSE_DEBUG */ #include +#include #include #include "gadget_chips.h" #define DRIVER_DESC "Linux USB Audio Gadget" #define DRIVER_VERSION "Feb 2, 2012" -/*-------------------------------------------------------------------------*/ - -/* - * Kbuild is not very cooperative with respect to linking separately - * compiled library objects into one module. So for now we won't use - * separate compilation ... ensuring init/exit sections work to shrink - * the runtime footprint, and giving us at least some parts of what - * a "gcc --combine ... part1.c part2.c part3.c ... " build would. - */ -#include "composite.c" USB_GADGET_COMPOSITE_OPTIONS(); /* string IDs are assigned dynamically */ diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c index 4e2060bf35e3515a31ef8b137265e2c6b72240a5..ba38d2a43723724ccb07225bba4d6916d8a5ab7b 100644 --- a/drivers/usb/gadget/cdc2.c +++ b/drivers/usb/gadget/cdc2.c @@ -43,7 +43,6 @@ USB_GADGET_COMPOSITE_OPTIONS(); * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" #include "u_serial.c" #include "f_acm.c" #include "f_ecm.c" diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index c7066cd4c95a0e08f71cc6b6f7f17ac626fedd8c..27ac366388275ec0cd29a4ef0932e8502d975615 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -154,6 +154,7 @@ int config_ep_by_speed(struct usb_gadget *g, } return 0; } +EXPORT_SYMBOL_GPL(config_ep_by_speed); /** * usb_add_function() - add a function to a configuration @@ -212,6 +213,7 @@ int usb_add_function(struct usb_configuration *config, function->name, function, value); return value; } +EXPORT_SYMBOL_GPL(usb_add_function); /** * usb_function_deactivate - prevent function and gadget enumeration @@ -248,6 +250,7 @@ int usb_function_deactivate(struct usb_function *function) spin_unlock_irqrestore(&cdev->lock, flags); return status; } +EXPORT_SYMBOL_GPL(usb_function_deactivate); /** * usb_function_activate - allow function and gadget enumeration @@ -278,6 +281,7 @@ int usb_function_activate(struct usb_function *function) spin_unlock_irqrestore(&cdev->lock, flags); return status; } +EXPORT_SYMBOL_GPL(usb_function_activate); /** * usb_interface_id() - allocate an unused interface ID @@ -314,6 +318,7 @@ int usb_interface_id(struct usb_configuration *config, } return -ENODEV; } +EXPORT_SYMBOL_GPL(usb_interface_id); static int config_buf(struct usb_configuration *config, enum usb_device_speed speed, void *buf, u8 type) @@ -754,6 +759,7 @@ int usb_add_config(struct usb_composite_dev *cdev, config->bConfigurationValue, status); return status; } +EXPORT_SYMBOL_GPL(usb_add_config); static void remove_config(struct usb_composite_dev *cdev, struct usb_configuration *config) @@ -947,6 +953,7 @@ int usb_string_id(struct usb_composite_dev *cdev) } return -ENODEV; } +EXPORT_SYMBOL_GPL(usb_string_id); /** * usb_string_ids() - allocate unused string IDs in batch @@ -978,6 +985,7 @@ int usb_string_ids_tab(struct usb_composite_dev *cdev, struct usb_string *str) return 0; } +EXPORT_SYMBOL_GPL(usb_string_ids_tab); /** * usb_string_ids_n() - allocate unused string IDs in batch @@ -1006,7 +1014,7 @@ int usb_string_ids_n(struct usb_composite_dev *c, unsigned n) c->next_string_id += n; return next + 1; } - +EXPORT_SYMBOL_GPL(usb_string_ids_n); /*-------------------------------------------------------------------------*/ @@ -1572,6 +1580,7 @@ int usb_composite_probe(struct usb_composite_driver *driver) return usb_gadget_probe_driver(gadget_driver); } +EXPORT_SYMBOL_GPL(usb_composite_probe); /** * usb_composite_unregister() - unregister a composite driver @@ -1584,6 +1593,7 @@ void usb_composite_unregister(struct usb_composite_driver *driver) { usb_gadget_unregister_driver(&driver->gadget_driver); } +EXPORT_SYMBOL_GPL(usb_composite_unregister); /** * usb_composite_setup_continue() - Continue with the control transfer @@ -1620,6 +1630,7 @@ void usb_composite_setup_continue(struct usb_composite_dev *cdev) spin_unlock_irqrestore(&cdev->lock, flags); } +EXPORT_SYMBOL_GPL(usb_composite_setup_continue); static char *composite_default_mfr(struct usb_gadget *gadget) { @@ -1672,3 +1683,4 @@ void usb_composite_overwrite_options(struct usb_composite_dev *cdev, dev_str[USB_GADGET_PRODUCT_IDX].s = covr->product; } } +EXPORT_SYMBOL_GPL(usb_composite_overwrite_options); diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index a5c2720676255d41f23fe75bf997811d1ae94b98..d7ec87e0bfcb6f5776a783b83728df0c88734afe 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -100,8 +100,6 @@ static inline bool has_rndis(void) * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" - #include "f_ecm.c" #include "f_subset.c" #ifdef USB_ETH_RNDIS diff --git a/drivers/usb/gadget/f_hid.c b/drivers/usb/gadget/f_hid.c index 77dbca099bcbd9e80c43ee58ae6fcfe7a57a234a..511e527178e23d0e3cb3787700b5f7cc4f3baa32 100644 --- a/drivers/usb/gadget/f_hid.c +++ b/drivers/usb/gadget/f_hid.c @@ -17,6 +17,7 @@ #include #include #include +#include #include static int major, minors; diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c index 9e62c20fb5bceb758eec14ec0d59243255826fdf..3953dd4d7186827d0ee65b3e631701a093e7f618 100644 --- a/drivers/usb/gadget/g_ffs.c +++ b/drivers/usb/gadget/g_ffs.c @@ -21,9 +21,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ - -#include "composite.c" - #if defined CONFIG_USB_FUNCTIONFS_ETH || defined CONFIG_USB_FUNCTIONFS_RNDIS # if defined USB_ETH_RNDIS # undef USB_ETH_RNDIS diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 59621ef7657df9e4040acf9c59989cb57fd5d763..4181524d1c4bf9dbc04f483b94183e3c00f702a5 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c @@ -30,13 +30,13 @@ #include #include +#include #include #include #include #include "gadget_chips.h" -#include "composite.c" #include "f_midi.c" /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/gadget/hid.c b/drivers/usb/gadget/hid.c index 0e2e357cc59e4db57db1fb51b99d0952423acd56..5fa1bfa8c6c6c56eec3367294081db785d730378 100644 --- a/drivers/usb/gadget/hid.c +++ b/drivers/usb/gadget/hid.c @@ -15,6 +15,8 @@ #include #include #include +#include +#include #include "gadget_chips.h" #define DRIVER_DESC "HID Gadget" @@ -34,9 +36,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ - -#include "composite.c" - #include "f_hid.c" diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c index 9eb2be6858032ada47d4db6d399f25c62021e8ab..080e577773d527cb12507b9f20a581c45c452a42 100644 --- a/drivers/usb/gadget/mass_storage.c +++ b/drivers/usb/gadget/mass_storage.c @@ -30,6 +30,7 @@ #include #include +#include /*-------------------------------------------------------------------------*/ @@ -45,8 +46,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ - -#include "composite.c" #include "f_mass_storage.c" /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 5bc5d96beaac5277dcf1b135c76c4190af5683b9..9d2e75c017dc7de6ad4c542620f34bbdf30690c1 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c @@ -40,9 +40,6 @@ MODULE_LICENSE("GPL"); * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ - -#include "composite.c" - #include "f_mass_storage.c" #include "u_serial.c" diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c index 343f3d364ef8543c4f660ca4b3876cb0bbcb8d01..b21ec269b8f5961fe5ec9503c66bb2f25d7d2dca 100644 --- a/drivers/usb/gadget/ncm.c +++ b/drivers/usb/gadget/ncm.c @@ -20,6 +20,8 @@ /* #define VERBOSE_DEBUG */ #include +#include +#include #include "u_ether.h" @@ -34,8 +36,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" - #include "f_ncm.c" #include "u_ether.c" diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c index 465766e41442507a7b476a580c66c433f5f2c94c..ad0cc347307389eaca14b09a50b57228cb403ad3 100644 --- a/drivers/usb/gadget/nokia.c +++ b/drivers/usb/gadget/nokia.c @@ -37,8 +37,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" - #include "u_serial.c" #include "f_acm.c" #include "f_ecm.c" diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 9bd994203d3d1f4b9f6cb9483f4f5db7d7d8ea65..e394050afd02aa002df2ecf7fad2323c58610073 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c @@ -37,22 +37,12 @@ #include #include +#include #include #include #include "gadget_chips.h" - -/* - * Kbuild is not very cooperative with respect to linking separately - * compiled library objects into one module. So for now we won't use - * separate compilation ... ensuring init/exit sections work to shrink - * the runtime footprint, and giving us at least some parts of what - * a "gcc --combine ... part1.c part2.c part3.c ... " build would. - */ -#include "composite.c" - -/*-------------------------------------------------------------------------*/ USB_GADGET_COMPOSITE_OPTIONS(); #define DRIVER_DESC "Printer Gadget" diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index bf12d55cd07b4492ee0c299093c73d15301f6ff7..f17d4626af55f6424432dfc35063e8a2f2188587 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -36,8 +36,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" - #include "f_acm.c" #include "f_obex.c" #include "f_serial.c" diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index b56d57d5979606b9c872681ecda4e72180be2974..eaa1005377fc58ff9304ced98db1169823d8d81d 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c @@ -25,8 +25,6 @@ #include #include -#include "composite.c" - #include "tcm_usb_gadget.h" USB_GADGET_COMPOSITE_OPTIONS(); diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c index 03591194b17a6d2382e7360cbc2c84c896892f25..69cf5c2cd33532ab75b313dcba80d347e17462b3 100644 --- a/drivers/usb/gadget/webcam.c +++ b/drivers/usb/gadget/webcam.c @@ -23,8 +23,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" - #include "uvc_queue.c" #include "uvc_video.c" #include "uvc_v4l2.c" diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index a837f3af2047b53bfee128d0ca074d544946133c..0dabffa5f493e565b8237cb6552ba3cb01205ff1 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -57,8 +57,6 @@ * the runtime footprint, and giving us at least some parts of what * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ -#include "composite.c" - #include "f_sourcesink.c" #include "f_loopback.c"