1 From 8d0698428822ce63f7269e7fe81fc4580807b9ac Mon Sep 17 00:00:00 2001
2 From: Lothar Waßmann <LW@KARO-electronics.de>
3 Date: Sun, 11 Mar 2012 15:08:46 +0100
4 Subject: usb gadget: fix a section mismatch when compiling g_ffs with CONFIG_USB_FUNCTIONFS_ETH
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
9 From: Lothar Waßmann <LW@KARO-electronics.de>
11 commit 8d0698428822ce63f7269e7fe81fc4580807b9ac upstream.
13 commit 28824b18ac4705e876a282a15ea0de8fc957551f:
14 |Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
15 |Date: Wed May 5 12:53:13 2010 +0200
17 | USB: gadget: __init and __exit tags removed
19 | __init, __initdata and __exit tags have have been removed from
20 | various files to make it possible for gadgets that do not use
21 | the __init/__exit tags to use those.
22 obviously missed (at least) this case leading to a section mismatch in
23 g_ffs.c when compiling with CONFIG_USB_FUNCTIONFS_ETH enabled.
25 Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
26 Acked-by: Michal Nazarewicz <mina86@mina86.com>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30 drivers/usb/gadget/f_subset.c | 34 +++++++++++++++++-----------------
31 1 file changed, 17 insertions(+), 17 deletions(-)
33 --- a/drivers/usb/gadget/f_subset.c
34 +++ b/drivers/usb/gadget/f_subset.c
35 @@ -74,7 +74,7 @@ static inline struct f_gether *func_to_g
37 /* interface descriptor: */
39 -static struct usb_interface_descriptor subset_data_intf __initdata = {
40 +static struct usb_interface_descriptor subset_data_intf = {
41 .bLength = sizeof subset_data_intf,
42 .bDescriptorType = USB_DT_INTERFACE,
44 @@ -87,7 +87,7 @@ static struct usb_interface_descriptor s
45 /* .iInterface = DYNAMIC */
48 -static struct usb_cdc_header_desc mdlm_header_desc __initdata = {
49 +static struct usb_cdc_header_desc mdlm_header_desc = {
50 .bLength = sizeof mdlm_header_desc,
51 .bDescriptorType = USB_DT_CS_INTERFACE,
52 .bDescriptorSubType = USB_CDC_HEADER_TYPE,
53 @@ -95,7 +95,7 @@ static struct usb_cdc_header_desc mdlm_h
54 .bcdCDC = cpu_to_le16(0x0110),
57 -static struct usb_cdc_mdlm_desc mdlm_desc __initdata = {
58 +static struct usb_cdc_mdlm_desc mdlm_desc = {
59 .bLength = sizeof mdlm_desc,
60 .bDescriptorType = USB_DT_CS_INTERFACE,
61 .bDescriptorSubType = USB_CDC_MDLM_TYPE,
62 @@ -111,7 +111,7 @@ static struct usb_cdc_mdlm_desc mdlm_des
63 * can't really use its struct. All we do here is say that we're using
64 * the submode of "SAFE" which directly matches the CDC Subset.
66 -static u8 mdlm_detail_desc[] __initdata = {
67 +static u8 mdlm_detail_desc[] = {
70 USB_CDC_MDLM_DETAIL_TYPE,
71 @@ -121,7 +121,7 @@ static u8 mdlm_detail_desc[] __initdata
72 0, /* network data capabilities ("raw" encapsulation) */
75 -static struct usb_cdc_ether_desc ether_desc __initdata = {
76 +static struct usb_cdc_ether_desc ether_desc = {
77 .bLength = sizeof ether_desc,
78 .bDescriptorType = USB_DT_CS_INTERFACE,
79 .bDescriptorSubType = USB_CDC_ETHERNET_TYPE,
80 @@ -136,7 +136,7 @@ static struct usb_cdc_ether_desc ether_d
82 /* full speed support: */
84 -static struct usb_endpoint_descriptor fs_subset_in_desc __initdata = {
85 +static struct usb_endpoint_descriptor fs_subset_in_desc = {
86 .bLength = USB_DT_ENDPOINT_SIZE,
87 .bDescriptorType = USB_DT_ENDPOINT,
89 @@ -144,7 +144,7 @@ static struct usb_endpoint_descriptor fs
90 .bmAttributes = USB_ENDPOINT_XFER_BULK,
93 -static struct usb_endpoint_descriptor fs_subset_out_desc __initdata = {
94 +static struct usb_endpoint_descriptor fs_subset_out_desc = {
95 .bLength = USB_DT_ENDPOINT_SIZE,
96 .bDescriptorType = USB_DT_ENDPOINT,
98 @@ -152,7 +152,7 @@ static struct usb_endpoint_descriptor fs
99 .bmAttributes = USB_ENDPOINT_XFER_BULK,
102 -static struct usb_descriptor_header *fs_eth_function[] __initdata = {
103 +static struct usb_descriptor_header *fs_eth_function[] = {
104 (struct usb_descriptor_header *) &subset_data_intf,
105 (struct usb_descriptor_header *) &mdlm_header_desc,
106 (struct usb_descriptor_header *) &mdlm_desc,
107 @@ -165,7 +165,7 @@ static struct usb_descriptor_header *fs_
109 /* high speed support: */
111 -static struct usb_endpoint_descriptor hs_subset_in_desc __initdata = {
112 +static struct usb_endpoint_descriptor hs_subset_in_desc = {
113 .bLength = USB_DT_ENDPOINT_SIZE,
114 .bDescriptorType = USB_DT_ENDPOINT,
116 @@ -173,7 +173,7 @@ static struct usb_endpoint_descriptor hs
117 .wMaxPacketSize = cpu_to_le16(512),
120 -static struct usb_endpoint_descriptor hs_subset_out_desc __initdata = {
121 +static struct usb_endpoint_descriptor hs_subset_out_desc = {
122 .bLength = USB_DT_ENDPOINT_SIZE,
123 .bDescriptorType = USB_DT_ENDPOINT,
125 @@ -181,7 +181,7 @@ static struct usb_endpoint_descriptor hs
126 .wMaxPacketSize = cpu_to_le16(512),
129 -static struct usb_descriptor_header *hs_eth_function[] __initdata = {
130 +static struct usb_descriptor_header *hs_eth_function[] = {
131 (struct usb_descriptor_header *) &subset_data_intf,
132 (struct usb_descriptor_header *) &mdlm_header_desc,
133 (struct usb_descriptor_header *) &mdlm_desc,
134 @@ -194,7 +194,7 @@ static struct usb_descriptor_header *hs_
136 /* super speed support: */
138 -static struct usb_endpoint_descriptor ss_subset_in_desc __initdata = {
139 +static struct usb_endpoint_descriptor ss_subset_in_desc = {
140 .bLength = USB_DT_ENDPOINT_SIZE,
141 .bDescriptorType = USB_DT_ENDPOINT,
143 @@ -202,7 +202,7 @@ static struct usb_endpoint_descriptor ss
144 .wMaxPacketSize = cpu_to_le16(1024),
147 -static struct usb_endpoint_descriptor ss_subset_out_desc __initdata = {
148 +static struct usb_endpoint_descriptor ss_subset_out_desc = {
149 .bLength = USB_DT_ENDPOINT_SIZE,
150 .bDescriptorType = USB_DT_ENDPOINT,
152 @@ -210,7 +210,7 @@ static struct usb_endpoint_descriptor ss
153 .wMaxPacketSize = cpu_to_le16(1024),
156 -static struct usb_ss_ep_comp_descriptor ss_subset_bulk_comp_desc __initdata = {
157 +static struct usb_ss_ep_comp_descriptor ss_subset_bulk_comp_desc = {
158 .bLength = sizeof ss_subset_bulk_comp_desc,
159 .bDescriptorType = USB_DT_SS_ENDPOINT_COMP,
161 @@ -219,7 +219,7 @@ static struct usb_ss_ep_comp_descriptor
162 /* .bmAttributes = 0, */
165 -static struct usb_descriptor_header *ss_eth_function[] __initdata = {
166 +static struct usb_descriptor_header *ss_eth_function[] = {
167 (struct usb_descriptor_header *) &subset_data_intf,
168 (struct usb_descriptor_header *) &mdlm_header_desc,
169 (struct usb_descriptor_header *) &mdlm_desc,
170 @@ -290,7 +290,7 @@ static void geth_disable(struct usb_func
172 /* serial function driver setup/binding */
176 geth_bind(struct usb_configuration *c, struct usb_function *f)
178 struct usb_composite_dev *cdev = c->cdev;
179 @@ -404,7 +404,7 @@ geth_unbind(struct usb_configuration *c,
180 * Caller must have called @gether_setup(). Caller is also responsible
181 * for calling @gether_cleanup() before module unload.
183 -int __init geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
184 +int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
186 struct f_gether *geth;