From dc995fc27c2e1c8edebfb2405ede23bd38153f7f Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior Date: Thu, 6 Sep 2012 20:11:12 +0200 Subject: [PATCH] usb: gadget: libcomposite: add epautoconf.c to libcomposite This patch adds epautoconf.c into libcomposite and updates all gadgets. Acked-by: Michal Nazarewicz Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Felipe Balbi --- drivers/usb/gadget/Makefile | 2 +- drivers/usb/gadget/acm_ms.c | 1 - drivers/usb/gadget/audio.c | 2 +- drivers/usb/gadget/cdc2.c | 1 - drivers/usb/gadget/dbgp.c | 3 --- drivers/usb/gadget/epautoconf.c | 6 ++++-- drivers/usb/gadget/ether.c | 1 - drivers/usb/gadget/file_storage.c | 13 ------------- drivers/usb/gadget/g_ffs.c | 1 - drivers/usb/gadget/gadget_chips.h | 2 ++ drivers/usb/gadget/gmidi.c | 1 - drivers/usb/gadget/hid.c | 2 +- drivers/usb/gadget/mass_storage.c | 1 - drivers/usb/gadget/multi.c | 1 - drivers/usb/gadget/ncm.c | 1 - drivers/usb/gadget/nokia.c | 1 - drivers/usb/gadget/printer.c | 1 - drivers/usb/gadget/serial.c | 1 - drivers/usb/gadget/tcm_usb_gadget.c | 1 - drivers/usb/gadget/webcam.c | 1 - drivers/usb/gadget/zero.c | 1 - 21 files changed, 9 insertions(+), 35 deletions(-) diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 9515ed0163b7..23d705f194ac 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -5,7 +5,7 @@ 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 +libcomposite-y := usbstring.o config.o epautoconf.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 3078d797f634..5db661d8590b 100644 --- a/drivers/usb/gadget/acm_ms.c +++ b/drivers/usb/gadget/acm_ms.c @@ -42,7 +42,6 @@ */ #include "composite.c" -#include "epautoconf.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 9e85df22e796..689d1422a1c0 100644 --- a/drivers/usb/gadget/audio.c +++ b/drivers/usb/gadget/audio.c @@ -14,6 +14,7 @@ #include #include +#include "gadget_chips.h" #define DRIVER_DESC "Linux USB Audio Gadget" #define DRIVER_VERSION "Feb 2, 2012" @@ -27,7 +28,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" /* string IDs are assigned dynamically */ diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c index d06d0791c70e..8e386cf377a5 100644 --- a/drivers/usb/gadget/cdc2.c +++ b/drivers/usb/gadget/cdc2.c @@ -44,7 +44,6 @@ */ #include "composite.c" -#include "epautoconf.c" #include "u_serial.c" #include "f_acm.c" #include "f_ecm.c" diff --git a/drivers/usb/gadget/dbgp.c b/drivers/usb/gadget/dbgp.c index cc1746597aab..87d165028162 100644 --- a/drivers/usb/gadget/dbgp.c +++ b/drivers/usb/gadget/dbgp.c @@ -13,9 +13,6 @@ #include #include -/* See comments in "zero.c" */ -#include "epautoconf.c" - #ifdef CONFIG_USB_G_DBGP_SERIAL #include "u_serial.c" #endif diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index d5a905dbed00..a777f7bd11b4 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -10,6 +10,7 @@ */ #include +#include #include #include #include @@ -315,6 +316,7 @@ found_ep: ep->comp_desc = NULL; return ep; } +EXPORT_SYMBOL_GPL(usb_ep_autoconfig_ss); /** * usb_ep_autoconfig() - choose an endpoint matching the @@ -354,7 +356,7 @@ struct usb_ep *usb_ep_autoconfig( { return usb_ep_autoconfig_ss(gadget, desc, NULL); } - +EXPORT_SYMBOL_GPL(usb_ep_autoconfig); /** * usb_ep_autoconfig_reset - reset endpoint autoconfig state @@ -375,4 +377,4 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget) gadget->in_epnum = 0; gadget->out_epnum = 0; } - +EXPORT_SYMBOL_GPL(usb_ep_autoconfig_reset); diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 557021e267ee..39eb718f796a 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -103,7 +103,6 @@ static inline bool has_rndis(void) * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" #include "f_ecm.c" #include "f_subset.c" diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 77cf1083099f..ce362f7e39d3 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -256,19 +256,6 @@ #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 "epautoconf.c" - -/*-------------------------------------------------------------------------*/ - #define DRIVER_DESC "File-backed Storage Gadget" #define DRIVER_NAME "g_file_storage" #define DRIVER_VERSION "1 September 2010" diff --git a/drivers/usb/gadget/g_ffs.c b/drivers/usb/gadget/g_ffs.c index 240957048d3f..c3a583ea9938 100644 --- a/drivers/usb/gadget/g_ffs.c +++ b/drivers/usb/gadget/g_ffs.c @@ -24,7 +24,6 @@ */ #include "composite.c" -#include "epautoconf.c" #if defined CONFIG_USB_FUNCTIONFS_ETH || defined CONFIG_USB_FUNCTIONFS_RNDIS # if defined USB_ETH_RNDIS diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index 0ccca58e7a8f..ba4e302e77d7 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h @@ -15,6 +15,8 @@ #ifndef __GADGET_CHIPS_H #define __GADGET_CHIPS_H +#include + /* * NOTICE: the entries below are alphabetical and should be kept * that way. diff --git a/drivers/usb/gadget/gmidi.c b/drivers/usb/gadget/gmidi.c index 68a79b42c5a8..0c70708ef80f 100644 --- a/drivers/usb/gadget/gmidi.c +++ b/drivers/usb/gadget/gmidi.c @@ -38,7 +38,6 @@ #include "gadget_chips.h" #include "composite.c" -#include "epautoconf.c" #include "f_midi.c" /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/gadget/hid.c b/drivers/usb/gadget/hid.c index 917c6eda916a..4880cdd9de43 100644 --- a/drivers/usb/gadget/hid.c +++ b/drivers/usb/gadget/hid.c @@ -16,6 +16,7 @@ #include #include +#include "gadget_chips.h" #define DRIVER_DESC "HID Gadget" #define DRIVER_VERSION "2010/03/16" @@ -35,7 +36,6 @@ */ #include "composite.c" -#include "epautoconf.c" #include "f_hid.c" diff --git a/drivers/usb/gadget/mass_storage.c b/drivers/usb/gadget/mass_storage.c index 9675e61c9a8d..0b0f008427ed 100644 --- a/drivers/usb/gadget/mass_storage.c +++ b/drivers/usb/gadget/mass_storage.c @@ -49,7 +49,6 @@ */ #include "composite.c" -#include "epautoconf.c" #include "f_mass_storage.c" /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 6b6c12802afc..72fb30141ff4 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c @@ -44,7 +44,6 @@ MODULE_LICENSE("GPL"); */ #include "composite.c" -#include "epautoconf.c" #include "f_mass_storage.c" diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c index ce8d08e44602..69b660b79c09 100644 --- a/drivers/usb/gadget/ncm.c +++ b/drivers/usb/gadget/ncm.c @@ -37,7 +37,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" #include "f_ncm.c" #include "u_ether.c" diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c index e2f4b9bdebc3..6834c6204df3 100644 --- a/drivers/usb/gadget/nokia.c +++ b/drivers/usb/gadget/nokia.c @@ -39,7 +39,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" #include "u_serial.c" #include "f_acm.c" diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 310b22d423a7..3d3d20d258f6 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c @@ -52,7 +52,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" /*-------------------------------------------------------------------------*/ diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index 39990bed0905..098c3d03dedd 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c @@ -38,7 +38,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" #include "f_acm.c" #include "f_obex.c" diff --git a/drivers/usb/gadget/tcm_usb_gadget.c b/drivers/usb/gadget/tcm_usb_gadget.c index 926e0facfba5..e64a759f100d 100644 --- a/drivers/usb/gadget/tcm_usb_gadget.c +++ b/drivers/usb/gadget/tcm_usb_gadget.c @@ -25,7 +25,6 @@ #include #include -#include "epautoconf.c" #include "composite.c" #include "tcm_usb_gadget.h" diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c index 5e500e8403fd..66dfca86b215 100644 --- a/drivers/usb/gadget/webcam.c +++ b/drivers/usb/gadget/webcam.c @@ -24,7 +24,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" #include "uvc_queue.c" #include "uvc_video.c" diff --git a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c index e39a3b5da101..9a9adee2911a 100644 --- a/drivers/usb/gadget/zero.c +++ b/drivers/usb/gadget/zero.c @@ -59,7 +59,6 @@ * a "gcc --combine ... part1.c part2.c part3.c ... " build would. */ #include "composite.c" -#include "epautoconf.c" #include "f_sourcesink.c" #include "f_loopback.c" -- 2.20.1