diff options
Diffstat (limited to 'drivers/usb/gadget/ether.c')
-rw-r--r-- | drivers/usb/gadget/ether.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 114fa024c22c..1690c9d68256 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c | |||
@@ -237,7 +237,7 @@ static u8 hostaddr[ETH_ALEN]; | |||
237 | * the first one present. That's to make Microsoft's drivers happy, | 237 | * the first one present. That's to make Microsoft's drivers happy, |
238 | * and to follow DOCSIS 1.0 (cable modem standard). | 238 | * and to follow DOCSIS 1.0 (cable modem standard). |
239 | */ | 239 | */ |
240 | static int __ref rndis_do_config(struct usb_configuration *c) | 240 | static int __init rndis_do_config(struct usb_configuration *c) |
241 | { | 241 | { |
242 | /* FIXME alloc iConfiguration string, set it in c->strings */ | 242 | /* FIXME alloc iConfiguration string, set it in c->strings */ |
243 | 243 | ||
@@ -251,7 +251,6 @@ static int __ref rndis_do_config(struct usb_configuration *c) | |||
251 | 251 | ||
252 | static struct usb_configuration rndis_config_driver = { | 252 | static struct usb_configuration rndis_config_driver = { |
253 | .label = "RNDIS", | 253 | .label = "RNDIS", |
254 | .bind = rndis_do_config, | ||
255 | .bConfigurationValue = 2, | 254 | .bConfigurationValue = 2, |
256 | /* .iConfiguration = DYNAMIC */ | 255 | /* .iConfiguration = DYNAMIC */ |
257 | .bmAttributes = USB_CONFIG_ATT_SELFPOWER, | 256 | .bmAttributes = USB_CONFIG_ATT_SELFPOWER, |
@@ -270,7 +269,7 @@ MODULE_PARM_DESC(use_eem, "use CDC EEM mode"); | |||
270 | /* | 269 | /* |
271 | * We _always_ have an ECM, CDC Subset, or EEM configuration. | 270 | * We _always_ have an ECM, CDC Subset, or EEM configuration. |
272 | */ | 271 | */ |
273 | static int __ref eth_do_config(struct usb_configuration *c) | 272 | static int __init eth_do_config(struct usb_configuration *c) |
274 | { | 273 | { |
275 | /* FIXME alloc iConfiguration string, set it in c->strings */ | 274 | /* FIXME alloc iConfiguration string, set it in c->strings */ |
276 | 275 | ||
@@ -289,7 +288,6 @@ static int __ref eth_do_config(struct usb_configuration *c) | |||
289 | 288 | ||
290 | static struct usb_configuration eth_config_driver = { | 289 | static struct usb_configuration eth_config_driver = { |
291 | /* .label = f(hardware) */ | 290 | /* .label = f(hardware) */ |
292 | .bind = eth_do_config, | ||
293 | .bConfigurationValue = 1, | 291 | .bConfigurationValue = 1, |
294 | /* .iConfiguration = DYNAMIC */ | 292 | /* .iConfiguration = DYNAMIC */ |
295 | .bmAttributes = USB_CONFIG_ATT_SELFPOWER, | 293 | .bmAttributes = USB_CONFIG_ATT_SELFPOWER, |
@@ -297,7 +295,7 @@ static struct usb_configuration eth_config_driver = { | |||
297 | 295 | ||
298 | /*-------------------------------------------------------------------------*/ | 296 | /*-------------------------------------------------------------------------*/ |
299 | 297 | ||
300 | static int __ref eth_bind(struct usb_composite_dev *cdev) | 298 | static int __init eth_bind(struct usb_composite_dev *cdev) |
301 | { | 299 | { |
302 | int gcnum; | 300 | int gcnum; |
303 | struct usb_gadget *gadget = cdev->gadget; | 301 | struct usb_gadget *gadget = cdev->gadget; |
@@ -373,12 +371,13 @@ static int __ref eth_bind(struct usb_composite_dev *cdev) | |||
373 | 371 | ||
374 | /* register our configuration(s); RNDIS first, if it's used */ | 372 | /* register our configuration(s); RNDIS first, if it's used */ |
375 | if (has_rndis()) { | 373 | if (has_rndis()) { |
376 | status = usb_add_config(cdev, &rndis_config_driver); | 374 | status = usb_add_config(cdev, &rndis_config_driver, |
375 | rndis_do_config); | ||
377 | if (status < 0) | 376 | if (status < 0) |
378 | goto fail; | 377 | goto fail; |
379 | } | 378 | } |
380 | 379 | ||
381 | status = usb_add_config(cdev, ð_config_driver); | 380 | status = usb_add_config(cdev, ð_config_driver, eth_do_config); |
382 | if (status < 0) | 381 | if (status < 0) |
383 | goto fail; | 382 | goto fail; |
384 | 383 | ||
@@ -402,7 +401,6 @@ static struct usb_composite_driver eth_driver = { | |||
402 | .name = "g_ether", | 401 | .name = "g_ether", |
403 | .dev = &device_desc, | 402 | .dev = &device_desc, |
404 | .strings = dev_strings, | 403 | .strings = dev_strings, |
405 | .bind = eth_bind, | ||
406 | .unbind = __exit_p(eth_unbind), | 404 | .unbind = __exit_p(eth_unbind), |
407 | }; | 405 | }; |
408 | 406 | ||
@@ -412,7 +410,7 @@ MODULE_LICENSE("GPL"); | |||
412 | 410 | ||
413 | static int __init init(void) | 411 | static int __init init(void) |
414 | { | 412 | { |
415 | return usb_composite_register(ð_driver); | 413 | return usb_composite_probe(ð_driver, eth_bind); |
416 | } | 414 | } |
417 | module_init(init); | 415 | module_init(init); |
418 | 416 | ||