summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2014-03-12 19:09:38 +0100
committerGreg Kroah-Hartman <greg@kroah.com>2014-03-12 12:44:49 -0700
commit5083fd7bdfe6760577235a724cf6dccae13652c2 (patch)
treedacbaeeebe30e17afab70cbb344305e212a77ba0 /drivers/usb/serial/usb-serial.c
parentd7c933ae7da0d0b112bfc7e86424d780aaeb2d2c (diff)
USB: serial: make bulk_out_size a lower limit
Drivers are allowed to override the default bulk-out buffer size (endpoint maximum packet size) in order to increase throughput, but it does not make much sense to allow buffers smaller than the default. Note that this is already how bulk_in_size is defined. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c5
1 files changed, 2 insertions, 3 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,
port = serial->port[i];
if (kfifo_alloc(&port->write_fifo, PAGE_SIZE, GFP_KERNEL))
goto probe_error;
- buffer_size = serial->type->bulk_out_size;
- if (!buffer_size)
- buffer_size = usb_endpoint_maxp(endpoint);
+ buffer_size = max_t(int, serial->type->bulk_out_size,
+ usb_endpoint_maxp(endpoint));
port->bulk_out_size = buffer_size;
port->bulk_out_endpointAddress = endpoint->bEndpointAddress;