aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/cdc_ether.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/cdc_ether.c')
-rw-r--r--drivers/net/usb/cdc_ether.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index f3ae88fdf332..8ab281b478f2 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -310,6 +310,26 @@ skip:
310 return -ENODEV; 310 return -ENODEV;
311 } 311 }
312 312
313 return 0;
314
315bad_desc:
316 dev_info(&dev->udev->dev, "bad CDC descriptors\n");
317 return -ENODEV;
318}
319EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
320
321
322/* like usbnet_generic_cdc_bind() but handles filter initialization
323 * correctly
324 */
325int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
326{
327 int rv;
328
329 rv = usbnet_generic_cdc_bind(dev, intf);
330 if (rv < 0)
331 goto bail_out;
332
313 /* Some devices don't initialise properly. In particular 333 /* Some devices don't initialise properly. In particular
314 * the packet filter is not reset. There are devices that 334 * the packet filter is not reset. There are devices that
315 * don't do reset all the way. So the packet filter should 335 * don't do reset all the way. So the packet filter should
@@ -317,13 +337,10 @@ skip:
317 */ 337 */
318 usbnet_cdc_update_filter(dev); 338 usbnet_cdc_update_filter(dev);
319 339
320 return 0; 340bail_out:
321 341 return rv;
322bad_desc:
323 dev_info(&dev->udev->dev, "bad CDC descriptors\n");
324 return -ENODEV;
325} 342}
326EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind); 343EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
327 344
328void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf) 345void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
329{ 346{
@@ -417,7 +434,7 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
417 BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) 434 BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
418 < sizeof(struct cdc_state))); 435 < sizeof(struct cdc_state)));
419 436
420 status = usbnet_generic_cdc_bind(dev, intf); 437 status = usbnet_ether_cdc_bind(dev, intf);
421 if (status < 0) 438 if (status < 0)
422 return status; 439 return status;
423 440