aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/cdc2.c
diff options
context:
space:
mode:
authorDavid Brownell <dbrownell@users.sourceforge.net>2008-08-18 20:43:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-10-16 12:24:47 -0400
commit8a1ce2c0447b1a0816f66fde2f832c31b5fbee2c (patch)
treef443998c3dcc9c8c9741fcfc92b9719cd1fef748 /drivers/usb/gadget/cdc2.c
parent352e2b961c885b98065c402e2ad85057d0a334b2 (diff)
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 @@
43 43
44/*-------------------------------------------------------------------------*/ 44/*-------------------------------------------------------------------------*/
45 45
46/*
47 * Kbuild is not very cooperative with respect to linking separately
48 * compiled library objects into one module. So for now we won't use
49 * separate compilation ... ensuring init/exit sections work to shrink
50 * the runtime footprint, and giving us at least some parts of what
51 * a "gcc --combine ... part1.c part2.c part3.c ... " build would.
52 */
53
54#include "composite.c"
55#include "usbstring.c"
56#include "config.c"
57#include "epautoconf.c"
58#include "u_serial.c"
59#include "f_acm.c"
60#include "f_ecm.c"
61#include "u_ether.c"
62
63/*-------------------------------------------------------------------------*/
64
46static struct usb_device_descriptor device_desc = { 65static struct usb_device_descriptor device_desc = {
47 .bLength = sizeof device_desc, 66 .bLength = sizeof device_desc,
48 .bDescriptorType = USB_DT_DEVICE, 67 .bDescriptorType = USB_DT_DEVICE,
@@ -148,7 +167,8 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
148 int status; 167 int status;
149 168
150 if (!can_support_ecm(cdev->gadget)) { 169 if (!can_support_ecm(cdev->gadget)) {
151 ERROR(cdev, "controller '%s' not usable\n", gadget->name); 170 dev_err(&gadget->dev, "controller '%s' not usable\n",
171 gadget->name);
152 return -EINVAL; 172 return -EINVAL;
153 } 173 }
154 174
@@ -203,7 +223,8 @@ static int __init cdc_bind(struct usb_composite_dev *cdev)
203 if (status < 0) 223 if (status < 0)
204 goto fail1; 224 goto fail1;
205 225
206 INFO(cdev, "%s, version: " DRIVER_VERSION "\n", DRIVER_DESC); 226 dev_info(&gadget->dev, "%s, version: " DRIVER_VERSION "\n",
227 DRIVER_DESC);
207 228
208 return 0; 229 return 0;
209 230