Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: remove endpoints setting checks from core and header

Remove the unused check for num_interrupt and friends as well as remove
them from the header file because no usb-serial drivers no longer
reference them.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

-34
-16
drivers/usb/serial/usb-serial.c
··· 861 861 serial->num_interrupt_in = num_interrupt_in; 862 862 serial->num_interrupt_out = num_interrupt_out; 863 863 864 - #if 0 865 - /* check that the device meets the driver's requirements */ 866 - if ((type->num_interrupt_in != NUM_DONT_CARE && 867 - type->num_interrupt_in != num_interrupt_in) 868 - || (type->num_interrupt_out != NUM_DONT_CARE && 869 - type->num_interrupt_out != num_interrupt_out) 870 - || (type->num_bulk_in != NUM_DONT_CARE && 871 - type->num_bulk_in != num_bulk_in) 872 - || (type->num_bulk_out != NUM_DONT_CARE && 873 - type->num_bulk_out != num_bulk_out)) { 874 - dbg("wrong number of endpoints"); 875 - kfree(serial); 876 - return -EIO; 877 - } 878 - #endif 879 - 880 864 /* found all that we need */ 881 865 dev_info(&interface->dev, "%s converter detected\n", 882 866 type->description);
-18
include/linux/usb/serial.h
··· 145 145 }; 146 146 #define to_usb_serial(d) container_of(d, struct usb_serial, kref) 147 147 148 - #define NUM_DONT_CARE 99 149 - 150 148 /* get and set the serial private data pointer helper functions */ 151 149 static inline void *usb_get_serial_data(struct usb_serial *serial) 152 150 { ··· 162 164 * used in the syslog messages when a device is inserted or removed. 163 165 * @id_table: pointer to a list of usb_device_id structures that define all 164 166 * of the devices this structure can support. 165 - * @num_interrupt_in: If a device doesn't have this many interrupt-in 166 - * endpoints, it won't be sent to the driver's attach() method. 167 - * (But it might still be sent to the probe() method.) 168 - * @num_interrupt_out: If a device doesn't have this many interrupt-out 169 - * endpoints, it won't be sent to the driver's attach() method. 170 - * (But it might still be sent to the probe() method.) 171 - * @num_bulk_in: If a device doesn't have this many bulk-in 172 - * endpoints, it won't be sent to the driver's attach() method. 173 - * (But it might still be sent to the probe() method.) 174 - * @num_bulk_out: If a device doesn't have this many bulk-out 175 - * endpoints, it won't be sent to the driver's attach() method. 176 - * (But it might still be sent to the probe() method.) 177 167 * @num_ports: the number of different ports this device will have. 178 168 * @calc_num_ports: pointer to a function to determine how many ports this 179 169 * device has dynamically. It will be called after the probe() ··· 197 211 struct usb_serial_driver { 198 212 const char *description; 199 213 const struct usb_device_id *id_table; 200 - char num_interrupt_in; 201 - char num_interrupt_out; 202 - char num_bulk_in; 203 - char num_bulk_out; 204 214 char num_ports; 205 215 206 216 struct list_head driver_list;