aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ether.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/ether.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/ether.c')
-rw-r--r--drivers/usb/gadget/ether.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 8320fcef0425..4fe1bec1c255 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -2131,7 +2131,7 @@ eth_req_free (struct usb_ep *ep, struct usb_request *req)
2131} 2131}
2132 2132
2133 2133
2134static void __exit 2134static void /* __init_or_exit */
2135eth_unbind (struct usb_gadget *gadget) 2135eth_unbind (struct usb_gadget *gadget)
2136{ 2136{
2137 struct eth_dev *dev = get_gadget_data (gadget); 2137 struct eth_dev *dev = get_gadget_data (gadget);
@@ -2158,7 +2158,7 @@ eth_unbind (struct usb_gadget *gadget)
2158 set_gadget_data (gadget, NULL); 2158 set_gadget_data (gadget, NULL);
2159} 2159}
2160 2160
2161static u8 __init nibble (unsigned char c) 2161static u8 __devinit nibble (unsigned char c)
2162{ 2162{
2163 if (likely (isdigit (c))) 2163 if (likely (isdigit (c)))
2164 return c - '0'; 2164 return c - '0';
@@ -2168,7 +2168,7 @@ static u8 __init nibble (unsigned char c)
2168 return 0; 2168 return 0;
2169} 2169}
2170 2170
2171static int __init get_ether_addr(const char *str, u8 *dev_addr) 2171static int __devinit get_ether_addr(const char *str, u8 *dev_addr)
2172{ 2172{
2173 if (str) { 2173 if (str) {
2174 unsigned i; 2174 unsigned i;
@@ -2189,7 +2189,7 @@ static int __init get_ether_addr(const char *str, u8 *dev_addr)
2189 return 1; 2189 return 1;
2190} 2190}
2191 2191
2192static int __init 2192static int __devinit
2193eth_bind (struct usb_gadget *gadget) 2193eth_bind (struct usb_gadget *gadget)
2194{ 2194{
2195 struct eth_dev *dev; 2195 struct eth_dev *dev;