Skip to content

Commit 28824b1

Browse files
Michal Nazarewiczgregkh
authored andcommitted
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. Files in question are related to: * the core composite framework, * the mass storage function (fixing a section mismatch) and * ethernet driver (ACM, ECM, RNDIS). Signed-off-by: Michal Nazarewicz <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: Marek Szyprowski <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8120a8a commit 28824b1

File tree

8 files changed

+71
-70
lines changed

8 files changed

+71
-70
lines changed

drivers/usb/gadget/composite.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ MODULE_PARM_DESC(iSerialNumber, "SerialNumber string");
8585
* This function returns the value of the function's bind(), which is
8686
* zero for success else a negative errno value.
8787
*/
88-
int __init usb_add_function(struct usb_configuration *config,
88+
int usb_add_function(struct usb_configuration *config,
8989
struct usb_function *function)
9090
{
9191
int value = -EINVAL;
@@ -215,7 +215,7 @@ int usb_function_activate(struct usb_function *function)
215215
* Returns the interface ID which was allocated; or -ENODEV if no
216216
* more interface IDs can be allocated.
217217
*/
218-
int __init usb_interface_id(struct usb_configuration *config,
218+
int usb_interface_id(struct usb_configuration *config,
219219
struct usb_function *function)
220220
{
221221
unsigned id = config->next_interface_id;
@@ -480,7 +480,7 @@ static int set_config(struct usb_composite_dev *cdev,
480480
* assigns global resources including string IDs, and per-configuration
481481
* resources such as interface IDs and endpoints.
482482
*/
483-
int __init usb_add_config(struct usb_composite_dev *cdev,
483+
int usb_add_config(struct usb_composite_dev *cdev,
484484
struct usb_configuration *config)
485485
{
486486
int status = -EINVAL;
@@ -677,7 +677,7 @@ static int get_string(struct usb_composite_dev *cdev,
677677
* ensure that for example different functions don't wrongly assign
678678
* different meanings to the same identifier.
679679
*/
680-
int __init usb_string_id(struct usb_composite_dev *cdev)
680+
int usb_string_id(struct usb_composite_dev *cdev)
681681
{
682682
if (cdev->next_string_id < 254) {
683683
/* string id 0 is reserved */
@@ -910,7 +910,7 @@ static ssize_t composite_show_suspended(struct device *dev,
910910

911911
static DEVICE_ATTR(suspended, 0444, composite_show_suspended, NULL);
912912

913-
static void /* __init_or_exit */
913+
static void
914914
composite_unbind(struct usb_gadget *gadget)
915915
{
916916
struct usb_composite_dev *cdev = get_gadget_data(gadget);
@@ -960,7 +960,7 @@ composite_unbind(struct usb_gadget *gadget)
960960
composite = NULL;
961961
}
962962

963-
static void __init
963+
static void
964964
string_override_one(struct usb_gadget_strings *tab, u8 id, const char *s)
965965
{
966966
struct usb_string *str = tab->strings;
@@ -973,7 +973,7 @@ string_override_one(struct usb_gadget_strings *tab, u8 id, const char *s)
973973
}
974974
}
975975

976-
static void __init
976+
static void
977977
string_override(struct usb_gadget_strings **tab, u8 id, const char *s)
978978
{
979979
while (*tab) {
@@ -982,7 +982,7 @@ string_override(struct usb_gadget_strings **tab, u8 id, const char *s)
982982
}
983983
}
984984

985-
static int __init composite_bind(struct usb_gadget *gadget)
985+
static int composite_bind(struct usb_gadget *gadget)
986986
{
987987
struct usb_composite_dev *cdev;
988988
int status = -ENOMEM;
@@ -1113,7 +1113,6 @@ static struct usb_gadget_driver composite_driver = {
11131113
.speed = USB_SPEED_HIGH,
11141114

11151115
.bind = composite_bind,
1116-
/* .unbind = __exit_p(composite_unbind), */
11171116
.unbind = composite_unbind,
11181117

11191118
.setup = composite_setup,
@@ -1142,7 +1141,7 @@ static struct usb_gadget_driver composite_driver = {
11421141
* while it was binding. That would usually be done in order to wait for
11431142
* some userspace participation.
11441143
*/
1145-
int __init usb_composite_register(struct usb_composite_driver *driver)
1144+
int usb_composite_register(struct usb_composite_driver *driver)
11461145
{
11471146
if (!driver || !driver->dev || !driver->bind || composite)
11481147
return -EINVAL;
@@ -1163,7 +1162,7 @@ int __init usb_composite_register(struct usb_composite_driver *driver)
11631162
* This function is used to unregister drivers using the composite
11641163
* driver framework.
11651164
*/
1166-
void /* __exit */ usb_composite_unregister(struct usb_composite_driver *driver)
1165+
void usb_composite_unregister(struct usb_composite_driver *driver)
11671166
{
11681167
if (composite != driver)
11691168
return;

drivers/usb/gadget/config.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int usb_gadget_config_buf(
128128
* with identifiers (for interfaces, strings, endpoints, and more)
129129
* as needed by a given function instance.
130130
*/
131-
struct usb_descriptor_header **__init
131+
struct usb_descriptor_header **
132132
usb_copy_descriptors(struct usb_descriptor_header **src)
133133
{
134134
struct usb_descriptor_header **tmp;
@@ -175,7 +175,7 @@ usb_copy_descriptors(struct usb_descriptor_header **src)
175175
* intended use is to help remembering the endpoint descriptor to use
176176
* when enabling a given endpoint.
177177
*/
178-
struct usb_endpoint_descriptor *__init
178+
struct usb_endpoint_descriptor *
179179
usb_find_endpoint(
180180
struct usb_descriptor_header **src,
181181
struct usb_descriptor_header **copy,

drivers/usb/gadget/epautoconf.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434

3535

3636
/* we must assign addresses for configurable endpoints (like net2280) */
37-
static __initdata unsigned epnum;
37+
static unsigned epnum;
3838

3939
// #define MANY_ENDPOINTS
4040
#ifdef MANY_ENDPOINTS
4141
/* more than 15 configurable endpoints */
42-
static __initdata unsigned in_epnum;
42+
static unsigned in_epnum;
4343
#endif
4444

4545

@@ -59,7 +59,7 @@ static __initdata unsigned in_epnum;
5959
* NOTE: each endpoint is unidirectional, as specified by its USB
6060
* descriptor; and isn't specific to a configuration or altsetting.
6161
*/
62-
static int __init
62+
static int
6363
ep_matches (
6464
struct usb_gadget *gadget,
6565
struct usb_ep *ep,
@@ -187,7 +187,7 @@ ep_matches (
187187
return 1;
188188
}
189189

190-
static struct usb_ep * __init
190+
static struct usb_ep *
191191
find_ep (struct usb_gadget *gadget, const char *name)
192192
{
193193
struct usb_ep *ep;
@@ -229,7 +229,7 @@ find_ep (struct usb_gadget *gadget, const char *name)
229229
*
230230
* On failure, this returns a null endpoint descriptor.
231231
*/
232-
struct usb_ep * __init usb_ep_autoconfig (
232+
struct usb_ep *usb_ep_autoconfig (
233233
struct usb_gadget *gadget,
234234
struct usb_endpoint_descriptor *desc
235235
)
@@ -304,7 +304,7 @@ struct usb_ep * __init usb_ep_autoconfig (
304304
* state such as ep->driver_data and the record of assigned endpoints
305305
* used by usb_ep_autoconfig().
306306
*/
307-
void __init usb_ep_autoconfig_reset (struct usb_gadget *gadget)
307+
void usb_ep_autoconfig_reset (struct usb_gadget *gadget)
308308
{
309309
struct usb_ep *ep;
310310

drivers/usb/gadget/f_acm.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ acm_iad_descriptor = {
116116
};
117117

118118

119-
static struct usb_interface_descriptor acm_control_interface_desc __initdata = {
119+
static struct usb_interface_descriptor acm_control_interface_desc = {
120120
.bLength = USB_DT_INTERFACE_SIZE,
121121
.bDescriptorType = USB_DT_INTERFACE,
122122
/* .bInterfaceNumber = DYNAMIC */
@@ -127,7 +127,7 @@ static struct usb_interface_descriptor acm_control_interface_desc __initdata = {
127127
/* .iInterface = DYNAMIC */
128128
};
129129

130-
static struct usb_interface_descriptor acm_data_interface_desc __initdata = {
130+
static struct usb_interface_descriptor acm_data_interface_desc = {
131131
.bLength = USB_DT_INTERFACE_SIZE,
132132
.bDescriptorType = USB_DT_INTERFACE,
133133
/* .bInterfaceNumber = DYNAMIC */
@@ -138,30 +138,30 @@ static struct usb_interface_descriptor acm_data_interface_desc __initdata = {
138138
/* .iInterface = DYNAMIC */
139139
};
140140

141-
static struct usb_cdc_header_desc acm_header_desc __initdata = {
141+
static struct usb_cdc_header_desc acm_header_desc = {
142142
.bLength = sizeof(acm_header_desc),
143143
.bDescriptorType = USB_DT_CS_INTERFACE,
144144
.bDescriptorSubType = USB_CDC_HEADER_TYPE,
145145
.bcdCDC = cpu_to_le16(0x0110),
146146
};
147147

148148
static struct usb_cdc_call_mgmt_descriptor
149-
acm_call_mgmt_descriptor __initdata = {
149+
acm_call_mgmt_descriptor = {
150150
.bLength = sizeof(acm_call_mgmt_descriptor),
151151
.bDescriptorType = USB_DT_CS_INTERFACE,
152152
.bDescriptorSubType = USB_CDC_CALL_MANAGEMENT_TYPE,
153153
.bmCapabilities = 0,
154154
/* .bDataInterface = DYNAMIC */
155155
};
156156

157-
static struct usb_cdc_acm_descriptor acm_descriptor __initdata = {
157+
static struct usb_cdc_acm_descriptor acm_descriptor = {
158158
.bLength = sizeof(acm_descriptor),
159159
.bDescriptorType = USB_DT_CS_INTERFACE,
160160
.bDescriptorSubType = USB_CDC_ACM_TYPE,
161161
.bmCapabilities = USB_CDC_CAP_LINE,
162162
};
163163

164-
static struct usb_cdc_union_desc acm_union_desc __initdata = {
164+
static struct usb_cdc_union_desc acm_union_desc = {
165165
.bLength = sizeof(acm_union_desc),
166166
.bDescriptorType = USB_DT_CS_INTERFACE,
167167
.bDescriptorSubType = USB_CDC_UNION_TYPE,
@@ -171,7 +171,7 @@ static struct usb_cdc_union_desc acm_union_desc __initdata = {
171171

172172
/* full speed support: */
173173

174-
static struct usb_endpoint_descriptor acm_fs_notify_desc __initdata = {
174+
static struct usb_endpoint_descriptor acm_fs_notify_desc = {
175175
.bLength = USB_DT_ENDPOINT_SIZE,
176176
.bDescriptorType = USB_DT_ENDPOINT,
177177
.bEndpointAddress = USB_DIR_IN,
@@ -180,21 +180,21 @@ static struct usb_endpoint_descriptor acm_fs_notify_desc __initdata = {
180180
.bInterval = 1 << GS_LOG2_NOTIFY_INTERVAL,
181181
};
182182

183-
static struct usb_endpoint_descriptor acm_fs_in_desc __initdata = {
183+
static struct usb_endpoint_descriptor acm_fs_in_desc = {
184184
.bLength = USB_DT_ENDPOINT_SIZE,
185185
.bDescriptorType = USB_DT_ENDPOINT,
186186
.bEndpointAddress = USB_DIR_IN,
187187
.bmAttributes = USB_ENDPOINT_XFER_BULK,
188188
};
189189

190-
static struct usb_endpoint_descriptor acm_fs_out_desc __initdata = {
190+
static struct usb_endpoint_descriptor acm_fs_out_desc = {
191191
.bLength = USB_DT_ENDPOINT_SIZE,
192192
.bDescriptorType = USB_DT_ENDPOINT,
193193
.bEndpointAddress = USB_DIR_OUT,
194194
.bmAttributes = USB_ENDPOINT_XFER_BULK,
195195
};
196196

197-
static struct usb_descriptor_header *acm_fs_function[] __initdata = {
197+
static struct usb_descriptor_header *acm_fs_function[] = {
198198
(struct usb_descriptor_header *) &acm_iad_descriptor,
199199
(struct usb_descriptor_header *) &acm_control_interface_desc,
200200
(struct usb_descriptor_header *) &acm_header_desc,
@@ -210,7 +210,7 @@ static struct usb_descriptor_header *acm_fs_function[] __initdata = {
210210

211211
/* high speed support: */
212212

213-
static struct usb_endpoint_descriptor acm_hs_notify_desc __initdata = {
213+
static struct usb_endpoint_descriptor acm_hs_notify_desc = {
214214
.bLength = USB_DT_ENDPOINT_SIZE,
215215
.bDescriptorType = USB_DT_ENDPOINT,
216216
.bEndpointAddress = USB_DIR_IN,
@@ -219,21 +219,21 @@ static struct usb_endpoint_descriptor acm_hs_notify_desc __initdata = {
219219
.bInterval = GS_LOG2_NOTIFY_INTERVAL+4,
220220
};
221221

222-
static struct usb_endpoint_descriptor acm_hs_in_desc __initdata = {
222+
static struct usb_endpoint_descriptor acm_hs_in_desc = {
223223
.bLength = USB_DT_ENDPOINT_SIZE,
224224
.bDescriptorType = USB_DT_ENDPOINT,
225225
.bmAttributes = USB_ENDPOINT_XFER_BULK,
226226
.wMaxPacketSize = cpu_to_le16(512),
227227
};
228228

229-
static struct usb_endpoint_descriptor acm_hs_out_desc __initdata = {
229+
static struct usb_endpoint_descriptor acm_hs_out_desc = {
230230
.bLength = USB_DT_ENDPOINT_SIZE,
231231
.bDescriptorType = USB_DT_ENDPOINT,
232232
.bmAttributes = USB_ENDPOINT_XFER_BULK,
233233
.wMaxPacketSize = cpu_to_le16(512),
234234
};
235235

236-
static struct usb_descriptor_header *acm_hs_function[] __initdata = {
236+
static struct usb_descriptor_header *acm_hs_function[] = {
237237
(struct usb_descriptor_header *) &acm_iad_descriptor,
238238
(struct usb_descriptor_header *) &acm_control_interface_desc,
239239
(struct usb_descriptor_header *) &acm_header_desc,
@@ -571,7 +571,7 @@ static int acm_send_break(struct gserial *port, int duration)
571571
/*-------------------------------------------------------------------------*/
572572

573573
/* ACM function driver setup/binding */
574-
static int __init
574+
static int
575575
acm_bind(struct usb_configuration *c, struct usb_function *f)
576576
{
577577
struct usb_composite_dev *cdev = c->cdev;
@@ -719,7 +719,7 @@ static inline bool can_support_cdc(struct usb_configuration *c)
719719
* handle all the ones it binds. Caller is also responsible
720720
* for calling @gserial_cleanup() before module unload.
721721
*/
722-
int __init acm_bind_config(struct usb_configuration *c, u8 port_num)
722+
int acm_bind_config(struct usb_configuration *c, u8 port_num)
723723
{
724724
struct f_acm *acm;
725725
int status;

0 commit comments

Comments
 (0)