summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ether.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-08-18 17:45:07 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-16 09:24:47 -0700
commit33376c1c043c05077b4ac79c33804266f6c45e49 (patch)
tree95d28177840c3eb1d650d7351319be2f4e141c5b /drivers/usb/gadget/ether.c
parent8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c (diff)
downloadblackbird-obmc-linux-33376c1c043c05077b4ac79c33804266f6c45e49.tar.gz
blackbird-obmc-linux-33376c1c043c05077b4ac79c33804266f6c45e49.zip
usb gadget: link fixes for network gadget
Change how the Ethernet/RNDIS gadget driver builds: don't use separate compilation, since it works poorly when key parts are library code (with init sections etc). Instead be as close as we can to "gcc --combine ...". This is a bit more complicated than most of the others because it had to resolve a few symbol collisions. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r--drivers/usb/gadget/ether.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index bcac2e68660d..944c8e889ab4 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -96,6 +96,28 @@ static inline bool has_rndis(void)
/*-------------------------------------------------------------------------*/
+/*
+ * 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"
+#include "usbstring.c"
+#include "config.c"
+#include "epautoconf.c"
+
+#include "f_ecm.c"
+#include "f_subset.c"
+#ifdef CONFIG_USB_ETH_RNDIS
+#include "f_rndis.c"
+#include "rndis.c"
+#endif
+#include "u_ether.c"
+
+/*-------------------------------------------------------------------------*/
+
/* DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
* Instead: allocate your own, using normal USB-IF procedures.
*/
@@ -293,7 +315,8 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
* but if the controller isn't recognized at all then
* that assumption is a bit more likely to be wrong.
*/
- WARNING(cdev, "controller '%s' not recognized; trying %s\n",
+ dev_warn(&gadget->dev,
+ "controller '%s' not recognized; trying %s\n",
gadget->name,
eth_config_driver.label);
device_desc.bcdDevice =
@@ -332,7 +355,8 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
if (status < 0)
goto fail;
- INFO(cdev, "%s, version: " DRIVER_VERSION "\n", DRIVER_DESC);
+ dev_info(&gadget->dev, "%s, version: " DRIVER_VERSION "\n",
+ DRIVER_DESC);
return 0;
OpenPOWER on IntegriCloud