diff options
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 5 | ||||
-rw-r--r-- | include/linux/usb/serial.h | 3 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 7c9dc28640bb..c68fc9fb7598 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -923,9 +923,8 @@ static int usb_serial_probe(struct usb_interface *interface, | |||
923 | port = serial->port[i]; | 923 | port = serial->port[i]; |
924 | if (kfifo_alloc(&port->write_fifo, PAGE_SIZE, GFP_KERNEL)) | 924 | if (kfifo_alloc(&port->write_fifo, PAGE_SIZE, GFP_KERNEL)) |
925 | goto probe_error; | 925 | goto probe_error; |
926 | buffer_size = serial->type->bulk_out_size; | 926 | buffer_size = max_t(int, serial->type->bulk_out_size, |
927 | if (!buffer_size) | 927 | usb_endpoint_maxp(endpoint)); |
928 | buffer_size = usb_endpoint_maxp(endpoint); | ||
929 | port->bulk_out_size = buffer_size; | 928 | port->bulk_out_size = buffer_size; |
930 | port->bulk_out_endpointAddress = endpoint->bEndpointAddress; | 929 | port->bulk_out_endpointAddress = endpoint->bEndpointAddress; |
931 | 930 | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 704a1ab8240c..9bb547c7bce7 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -190,7 +190,8 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) | |||
190 | * @num_ports: the number of different ports this device will have. | 190 | * @num_ports: the number of different ports this device will have. |
191 | * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer | 191 | * @bulk_in_size: minimum number of bytes to allocate for bulk-in buffer |
192 | * (0 = end-point size) | 192 | * (0 = end-point size) |
193 | * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size) | 193 | * @bulk_out_size: minimum number of bytes to allocate for bulk-out buffer |
194 | * (0 = end-point size) | ||
194 | * @calc_num_ports: pointer to a function to determine how many ports this | 195 | * @calc_num_ports: pointer to a function to determine how many ports this |
195 | * device has dynamically. It will be called after the probe() | 196 | * device has dynamically. It will be called after the probe() |
196 | * callback is called, but before attach() | 197 | * callback is called, but before attach() |