Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb gadget: fix a section mismatch when compiling g_ffs with CONFIG_USB_FUNCTIONFS_ETH

commit 28824b18ac4705e876a282a15ea0de8fc957551f:
|Author: Michal Nazarewicz <m.nazarewicz@samsung.com>
|Date: Wed May 5 12:53:13 2010 +0200
|
| USB: gadget: __init and __exit tags removed
|
| __init, __initdata and __exit tags have have been removed from
| various files to make it possible for gadgets that do not use
| the __init/__exit tags to use those.
obviously missed (at least) this case leading to a section mismatch in
g_ffs.c when compiling with CONFIG_USB_FUNCTIONFS_ETH enabled.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Lothar Waßmann and committed by
Greg Kroah-Hartman
8d069842 a6a36008

+17 -17
+17 -17
drivers/usb/gadget/f_subset.c
··· 74 74 75 75 /* interface descriptor: */ 76 76 77 - static struct usb_interface_descriptor subset_data_intf __initdata = { 77 + static struct usb_interface_descriptor subset_data_intf = { 78 78 .bLength = sizeof subset_data_intf, 79 79 .bDescriptorType = USB_DT_INTERFACE, 80 80 ··· 87 87 /* .iInterface = DYNAMIC */ 88 88 }; 89 89 90 - static struct usb_cdc_header_desc mdlm_header_desc __initdata = { 90 + static struct usb_cdc_header_desc mdlm_header_desc = { 91 91 .bLength = sizeof mdlm_header_desc, 92 92 .bDescriptorType = USB_DT_CS_INTERFACE, 93 93 .bDescriptorSubType = USB_CDC_HEADER_TYPE, ··· 95 95 .bcdCDC = cpu_to_le16(0x0110), 96 96 }; 97 97 98 - static struct usb_cdc_mdlm_desc mdlm_desc __initdata = { 98 + static struct usb_cdc_mdlm_desc mdlm_desc = { 99 99 .bLength = sizeof mdlm_desc, 100 100 .bDescriptorType = USB_DT_CS_INTERFACE, 101 101 .bDescriptorSubType = USB_CDC_MDLM_TYPE, ··· 111 111 * can't really use its struct. All we do here is say that we're using 112 112 * the submode of "SAFE" which directly matches the CDC Subset. 113 113 */ 114 - static u8 mdlm_detail_desc[] __initdata = { 114 + static u8 mdlm_detail_desc[] = { 115 115 6, 116 116 USB_DT_CS_INTERFACE, 117 117 USB_CDC_MDLM_DETAIL_TYPE, ··· 121 121 0, /* network data capabilities ("raw" encapsulation) */ 122 122 }; 123 123 124 - static struct usb_cdc_ether_desc ether_desc __initdata = { 124 + static struct usb_cdc_ether_desc ether_desc = { 125 125 .bLength = sizeof ether_desc, 126 126 .bDescriptorType = USB_DT_CS_INTERFACE, 127 127 .bDescriptorSubType = USB_CDC_ETHERNET_TYPE, ··· 136 136 137 137 /* full speed support: */ 138 138 139 - static struct usb_endpoint_descriptor fs_subset_in_desc __initdata = { 139 + static struct usb_endpoint_descriptor fs_subset_in_desc = { 140 140 .bLength = USB_DT_ENDPOINT_SIZE, 141 141 .bDescriptorType = USB_DT_ENDPOINT, 142 142 ··· 144 144 .bmAttributes = USB_ENDPOINT_XFER_BULK, 145 145 }; 146 146 147 - static struct usb_endpoint_descriptor fs_subset_out_desc __initdata = { 147 + static struct usb_endpoint_descriptor fs_subset_out_desc = { 148 148 .bLength = USB_DT_ENDPOINT_SIZE, 149 149 .bDescriptorType = USB_DT_ENDPOINT, 150 150 ··· 152 152 .bmAttributes = USB_ENDPOINT_XFER_BULK, 153 153 }; 154 154 155 - static struct usb_descriptor_header *fs_eth_function[] __initdata = { 155 + static struct usb_descriptor_header *fs_eth_function[] = { 156 156 (struct usb_descriptor_header *) &subset_data_intf, 157 157 (struct usb_descriptor_header *) &mdlm_header_desc, 158 158 (struct usb_descriptor_header *) &mdlm_desc, ··· 165 165 166 166 /* high speed support: */ 167 167 168 - static struct usb_endpoint_descriptor hs_subset_in_desc __initdata = { 168 + static struct usb_endpoint_descriptor hs_subset_in_desc = { 169 169 .bLength = USB_DT_ENDPOINT_SIZE, 170 170 .bDescriptorType = USB_DT_ENDPOINT, 171 171 ··· 173 173 .wMaxPacketSize = cpu_to_le16(512), 174 174 }; 175 175 176 - static struct usb_endpoint_descriptor hs_subset_out_desc __initdata = { 176 + static struct usb_endpoint_descriptor hs_subset_out_desc = { 177 177 .bLength = USB_DT_ENDPOINT_SIZE, 178 178 .bDescriptorType = USB_DT_ENDPOINT, 179 179 ··· 181 181 .wMaxPacketSize = cpu_to_le16(512), 182 182 }; 183 183 184 - static struct usb_descriptor_header *hs_eth_function[] __initdata = { 184 + static struct usb_descriptor_header *hs_eth_function[] = { 185 185 (struct usb_descriptor_header *) &subset_data_intf, 186 186 (struct usb_descriptor_header *) &mdlm_header_desc, 187 187 (struct usb_descriptor_header *) &mdlm_desc, ··· 194 194 195 195 /* super speed support: */ 196 196 197 - static struct usb_endpoint_descriptor ss_subset_in_desc __initdata = { 197 + static struct usb_endpoint_descriptor ss_subset_in_desc = { 198 198 .bLength = USB_DT_ENDPOINT_SIZE, 199 199 .bDescriptorType = USB_DT_ENDPOINT, 200 200 ··· 202 202 .wMaxPacketSize = cpu_to_le16(1024), 203 203 }; 204 204 205 - static struct usb_endpoint_descriptor ss_subset_out_desc __initdata = { 205 + static struct usb_endpoint_descriptor ss_subset_out_desc = { 206 206 .bLength = USB_DT_ENDPOINT_SIZE, 207 207 .bDescriptorType = USB_DT_ENDPOINT, 208 208 ··· 210 210 .wMaxPacketSize = cpu_to_le16(1024), 211 211 }; 212 212 213 - static struct usb_ss_ep_comp_descriptor ss_subset_bulk_comp_desc __initdata = { 213 + static struct usb_ss_ep_comp_descriptor ss_subset_bulk_comp_desc = { 214 214 .bLength = sizeof ss_subset_bulk_comp_desc, 215 215 .bDescriptorType = USB_DT_SS_ENDPOINT_COMP, 216 216 ··· 219 219 /* .bmAttributes = 0, */ 220 220 }; 221 221 222 - static struct usb_descriptor_header *ss_eth_function[] __initdata = { 222 + static struct usb_descriptor_header *ss_eth_function[] = { 223 223 (struct usb_descriptor_header *) &subset_data_intf, 224 224 (struct usb_descriptor_header *) &mdlm_header_desc, 225 225 (struct usb_descriptor_header *) &mdlm_desc, ··· 290 290 291 291 /* serial function driver setup/binding */ 292 292 293 - static int __init 293 + static int 294 294 geth_bind(struct usb_configuration *c, struct usb_function *f) 295 295 { 296 296 struct usb_composite_dev *cdev = c->cdev; ··· 404 404 * Caller must have called @gether_setup(). Caller is also responsible 405 405 * for calling @gether_cleanup() before module unload. 406 406 */ 407 - int __init geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]) 407 + int geth_bind_config(struct usb_configuration *c, u8 ethaddr[ETH_ALEN]) 408 408 { 409 409 struct f_gether *geth; 410 410 int status;