diff options
Diffstat (limited to 'drivers/usb/gadget/ncm.c')
-rw-r--r-- | drivers/usb/gadget/ncm.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/usb/gadget/ncm.c b/drivers/usb/gadget/ncm.c index a22ad9af0565..3b02fd4649ce 100644 --- a/drivers/usb/gadget/ncm.c +++ b/drivers/usb/gadget/ncm.c | |||
@@ -111,6 +111,7 @@ static struct usb_gadget_strings *dev_strings[] = { | |||
111 | NULL, | 111 | NULL, |
112 | }; | 112 | }; |
113 | 113 | ||
114 | struct eth_dev *the_dev; | ||
114 | static u8 hostaddr[ETH_ALEN]; | 115 | static u8 hostaddr[ETH_ALEN]; |
115 | 116 | ||
116 | /*-------------------------------------------------------------------------*/ | 117 | /*-------------------------------------------------------------------------*/ |
@@ -124,7 +125,7 @@ static int __init ncm_do_config(struct usb_configuration *c) | |||
124 | c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; | 125 | c->bmAttributes |= USB_CONFIG_ATT_WAKEUP; |
125 | } | 126 | } |
126 | 127 | ||
127 | return ncm_bind_config(c, hostaddr); | 128 | return ncm_bind_config(c, hostaddr, the_dev); |
128 | } | 129 | } |
129 | 130 | ||
130 | static struct usb_configuration ncm_config_driver = { | 131 | static struct usb_configuration ncm_config_driver = { |
@@ -143,9 +144,9 @@ static int __init gncm_bind(struct usb_composite_dev *cdev) | |||
143 | int status; | 144 | int status; |
144 | 145 | ||
145 | /* set up network link layer */ | 146 | /* set up network link layer */ |
146 | status = gether_setup(cdev->gadget, hostaddr); | 147 | the_dev = gether_setup(cdev->gadget, hostaddr); |
147 | if (status < 0) | 148 | if (IS_ERR(the_dev)) |
148 | return status; | 149 | return PTR_ERR(the_dev); |
149 | 150 | ||
150 | /* Allocate string descriptor numbers ... note that string | 151 | /* Allocate string descriptor numbers ... note that string |
151 | * contents can be overridden by the composite_dev glue. | 152 | * contents can be overridden by the composite_dev glue. |
@@ -168,13 +169,13 @@ static int __init gncm_bind(struct usb_composite_dev *cdev) | |||
168 | return 0; | 169 | return 0; |
169 | 170 | ||
170 | fail: | 171 | fail: |
171 | gether_cleanup(); | 172 | gether_cleanup(the_dev); |
172 | return status; | 173 | return status; |
173 | } | 174 | } |
174 | 175 | ||
175 | static int __exit gncm_unbind(struct usb_composite_dev *cdev) | 176 | static int __exit gncm_unbind(struct usb_composite_dev *cdev) |
176 | { | 177 | { |
177 | gether_cleanup(); | 178 | gether_cleanup(the_dev); |
178 | return 0; | 179 | return 0; |
179 | } | 180 | } |
180 | 181 | ||