mirror of https://github.com/OpenIPC/firmware.git
				
				
				
			
		
			
				
	
	
		
			56 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Diff
		
	
	
| --- linux-4.9.37/drivers/net/usb/cdc_ether.c	2017-07-12 16:42:41.000000000 +0300
 | |
| +++ linux-4.9.y/drivers/net/usb/cdc_ether.c	2021-06-07 13:01:33.000000000 +0300
 | |
| @@ -310,6 +310,26 @@
 | |
|  		return -ENODEV;
 | |
|  	}
 | |
|  
 | |
| +	return 0;
 | |
| +
 | |
| +bad_desc:
 | |
| +	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
 | |
| +	return -ENODEV;
 | |
| +}
 | |
| +EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
 | |
| +
 | |
| +
 | |
| +/* like usbnet_generic_cdc_bind() but handles filter initialization
 | |
| + * correctly
 | |
| + */
 | |
| +int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 | |
| +{
 | |
| +	int rv;
 | |
| +
 | |
| +	rv = usbnet_generic_cdc_bind(dev, intf);
 | |
| +	if (rv < 0)
 | |
| +		goto bail_out;
 | |
| +
 | |
|  	/* Some devices don't initialise properly. In particular
 | |
|  	 * the packet filter is not reset. There are devices that
 | |
|  	 * don't do reset all the way. So the packet filter should
 | |
| @@ -317,13 +337,10 @@
 | |
|  	 */
 | |
|  	usbnet_cdc_update_filter(dev);
 | |
|  
 | |
| -	return 0;
 | |
| -
 | |
| -bad_desc:
 | |
| -	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
 | |
| -	return -ENODEV;
 | |
| +bail_out:
 | |
| +	return rv;
 | |
|  }
 | |
| -EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
 | |
| +EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
 | |
|  
 | |
|  void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
 | |
|  {
 | |
| @@ -417,7 +434,7 @@
 | |
|  	BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
 | |
|  			< sizeof(struct cdc_state)));
 | |
|  
 | |
| -	status = usbnet_generic_cdc_bind(dev, intf);
 | |
| +	status = usbnet_ether_cdc_bind(dev, intf);
 | |
|  	if (status < 0)
 | |
|  		return status;
 | |
|  
 |