aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/epautoconf.c
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-07-06 18:48:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-07-12 19:03:24 -0400
commita353678d3136306c1d00f0d2319de1dac8a6b1db (patch)
treeee68e60ab3611053ba91aedd74e673337601760d /drivers/usb/gadget/epautoconf.c
parent5501a48c15d4a3b81bee1358eb195e26c798d78f (diff)
[PATCH] USB: gadget section fixups
Recent section changes broke gadget builds on some platforms. This patch is the best fix that's available until better section markings exist: - There's a lot of cleanup code that gets used in both init and exit paths; stop marking it as "__exit". (Best fix for this would be an "__init_or_exit" section marking, putting the cleanup in __init when __exit sections get discarded else in __exit.) - Stop marking the use-once probe routines as "__init" since references to those routines are not allowed from driver structures. They're now marked "__devinit", which in practice is a net lose. (Best fix for this is likely to separate such use-once probe routines from the driver structure ... but in general, all busses that aren't hotpluggable will be forced to waste memory for all probe-only code.) In general these broken section rules waste an average of two to four kBytes per driver of code bloat ... because none of the relevant code can ever be reused after module initialization. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/epautoconf.c')
-rw-r--r--drivers/usb/gadget/epautoconf.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index f7c6d758e1b0..53d584589c26 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -34,12 +34,12 @@
34 34
35 35
36/* we must assign addresses for configurable endpoints (like net2280) */ 36/* we must assign addresses for configurable endpoints (like net2280) */
37static __initdata unsigned epnum; 37static __devinitdata unsigned epnum;
38 38
39// #define MANY_ENDPOINTS 39// #define MANY_ENDPOINTS
40#ifdef MANY_ENDPOINTS 40#ifdef MANY_ENDPOINTS
41/* more than 15 configurable endpoints */ 41/* more than 15 configurable endpoints */
42static __initdata unsigned in_epnum; 42static __devinitdata unsigned in_epnum;
43#endif 43#endif
44 44
45 45
@@ -59,7 +59,7 @@ static __initdata unsigned in_epnum;
59 * NOTE: each endpoint is unidirectional, as specified by its USB 59 * NOTE: each endpoint is unidirectional, as specified by its USB
60 * descriptor; and isn't specific to a configuration or altsetting. 60 * descriptor; and isn't specific to a configuration or altsetting.
61 */ 61 */
62static int __init 62static int __devinit
63ep_matches ( 63ep_matches (
64 struct usb_gadget *gadget, 64 struct usb_gadget *gadget,
65 struct usb_ep *ep, 65 struct usb_ep *ep,
@@ -73,7 +73,7 @@ ep_matches (
73 /* endpoint already claimed? */ 73 /* endpoint already claimed? */
74 if (0 != ep->driver_data) 74 if (0 != ep->driver_data)
75 return 0; 75 return 0;
76 76
77 /* only support ep0 for portable CONTROL traffic */ 77 /* only support ep0 for portable CONTROL traffic */
78 type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; 78 type = desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
79 if (USB_ENDPOINT_XFER_CONTROL == type) 79 if (USB_ENDPOINT_XFER_CONTROL == type)
@@ -186,7 +186,7 @@ ep_matches (
186 return 1; 186 return 1;
187} 187}
188 188
189static struct usb_ep * __init 189static struct usb_ep * __devinit
190find_ep (struct usb_gadget *gadget, const char *name) 190find_ep (struct usb_gadget *gadget, const char *name)
191{ 191{
192 struct usb_ep *ep; 192 struct usb_ep *ep;
@@ -228,7 +228,7 @@ find_ep (struct usb_gadget *gadget, const char *name)
228 * 228 *
229 * On failure, this returns a null endpoint descriptor. 229 * On failure, this returns a null endpoint descriptor.
230 */ 230 */
231struct usb_ep * __init usb_ep_autoconfig ( 231struct usb_ep * __devinit usb_ep_autoconfig (
232 struct usb_gadget *gadget, 232 struct usb_gadget *gadget,
233 struct usb_endpoint_descriptor *desc 233 struct usb_endpoint_descriptor *desc
234) 234)
@@ -276,7 +276,7 @@ struct usb_ep * __init usb_ep_autoconfig (
276 return ep; 276 return ep;
277 } 277 }
278 278
279 /* Second, look at endpoints until an unclaimed one looks usable */ 279 /* Second, look at endpoints until an unclaimed one looks usable */
280 list_for_each_entry (ep, &gadget->ep_list, ep_list) { 280 list_for_each_entry (ep, &gadget->ep_list, ep_list) {
281 if (ep_matches (gadget, ep, desc)) 281 if (ep_matches (gadget, ep, desc))
282 return ep; 282 return ep;
@@ -295,7 +295,7 @@ struct usb_ep * __init usb_ep_autoconfig (
295 * state such as ep->driver_data and the record of assigned endpoints 295 * state such as ep->driver_data and the record of assigned endpoints
296 * used by usb_ep_autoconfig(). 296 * used by usb_ep_autoconfig().
297 */ 297 */
298void __init usb_ep_autoconfig_reset (struct usb_gadget *gadget) 298void __devinit usb_ep_autoconfig_reset (struct usb_gadget *gadget)
299{ 299{
300 struct usb_ep *ep; 300 struct usb_ep *ep;
301 301