diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-12-24 00:10:12 +0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-04-03 15:43:31 +0400 |
commit | d6a0143985489e470a118605352f4b18df0ce142 (patch) | |
tree | 9fe2505807f5d5a721914dcb175542d4e342e414 /drivers/usb/gadget/cdc2.c | |
parent | 15761826eecda192f4d1527e08c32193a03e94b7 (diff) | |
download | linux-d6a0143985489e470a118605352f4b18df0ce142.tar.xz |
usb: gadget: move the global the_dev variable to their users
the u_ether.c file has a global variable named the_dev which keeps a
pointer to the network device after it has been created via
gether_setup_name(). It is only used internally by u_ether. This patches
moves the variable to its users and passes it via the port.ioport where
it is saved later anyway.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/cdc2.c')
-rw-r--r-- | drivers/usb/gadget/cdc2.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c index a7d6f7026757..61023aae9865 100644 --- a/drivers/usb/gadget/cdc2.c +++ b/drivers/usb/gadget/cdc2.c @@ -103,7 +103,7 @@ static struct usb_gadget_strings *dev_strings[] = { }; static u8 hostaddr[ETH_ALEN]; - +static struct eth_dev *the_dev; /*-------------------------------------------------------------------------*/ static struct usb_function *f_acm; static struct usb_function_instance *fi_serial; @@ -122,7 +122,7 @@ static int __init cdc_do_config(struct usb_configuration *c) c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; } - status = ecm_bind_config(c, hostaddr); + status = ecm_bind_config(c, hostaddr, the_dev); if (status < 0) return status; @@ -169,9 +169,9 @@ static int __init cdc_bind(struct usb_composite_dev *cdev) } /* set up network link layer */ - status = gether_setup(cdev->gadget, hostaddr); - if (status < 0) - return status; + the_dev = gether_setup(cdev->gadget, hostaddr); + if (IS_ERR(the_dev)) + return PTR_ERR(the_dev); /* set up serial link layer */ status = gserial_alloc_line(&tty_line); @@ -202,7 +202,7 @@ static int __init cdc_bind(struct usb_composite_dev *cdev) fail1: gserial_free_line(tty_line); fail0: - gether_cleanup(); + gether_cleanup(the_dev); return status; } @@ -211,7 +211,7 @@ static int __exit cdc_unbind(struct usb_composite_dev *cdev) usb_put_function(f_acm); usb_put_function_instance(fi_serial); gserial_free_line(tty_line); - gether_cleanup(); + gether_cleanup(the_dev); return 0; } |