summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/cdc2.c
diff options
context:
space:
mode:
authorDavid Brownell2008-08-19 02:43:56 +0200
committerGreg Kroah-Hartman2008-10-16 18:24:47 +0200
commit8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c (patch)
treef443998c3dcc9c8c9741fcfc92b9719cd1fef748 /drivers/usb/gadget/cdc2.c
parentusb gadget: link fixes for storage gadget (diff)
downloadkernel-qcow2-linux-8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c.tar.gz
kernel-qcow2-linux-8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c.tar.xz
kernel-qcow2-linux-8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c.zip
usb gadget: link fixes for cdc composite gadget
Change how the CDC Composite 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 ...". Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/cdc2.c')
-rw-r--r--drivers/usb/gadget/cdc2.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c
index a39a4b940c33..a724fc149850 100644
--- a/drivers/usb/gadget/cdc2.c
+++ b/drivers/usb/gadget/cdc2.c
@@ -43,6 +43,25 @@
/*-------------------------------------------------------------------------*/
+/*
+ * 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 "u_serial.c"
+#include "f_acm.c"
+#include "f_ecm.c"
+#include "u_ether.c"
+
+/*-------------------------------------------------------------------------*/
+
static struct usb_device_descriptor device_desc = {
.bLength = sizeof device_desc,
.bDescriptorType = USB_DT_DEVICE,
@@ -148,7 +167,8 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
int status;
if (!can_support_ecm(cdev->gadget)) {
- ERROR(cdev, "controller '%s' not usable\n", gadget->name);
+ dev_err(&gadget->dev, "controller '%s' not usable\n",
+ gadget->name);
return -EINVAL;
}
@@ -203,7 +223,8 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
if (status < 0)
goto fail1;
- INFO(cdev, "%s, version: " DRIVER_VERSION "\n", DRIVER_DESC);
+ dev_info(&gadget->dev, "%s, version: " DRIVER_VERSION "\n",
+ DRIVER_DESC);
return 0;