aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/generic.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2010-03-17 18:05:54 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-05-20 16:21:33 -0400
commit056afc0f01701c4c779ac5b4f2dd9058063f337c (patch)
tree9700b245fd8ce0cb0720c160d18fc87a0260801c /drivers/usb/serial/generic.c
parent41bd72f9041def8e3334d3e3693862d078f5cb9a (diff)
USB: serial: remove unnecessary re-initialisation of generic urbs
The generic read and write bulk urbs are initialised when allocated in usb_serial_probe. The only field that needs to be updated after that is the transfer_buffer_length of the write urb. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r--drivers/usb/serial/generic.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index d8dd3a59f56a..ffc2f163bb59 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -256,7 +256,6 @@ error_no_buffer:
256 */ 256 */
257static int usb_serial_generic_write_start(struct usb_serial_port *port) 257static int usb_serial_generic_write_start(struct usb_serial_port *port)
258{ 258{
259 struct usb_serial *serial = port->serial;
260 unsigned char *data; 259 unsigned char *data;
261 int result; 260 int result;
262 int count; 261 int count;
@@ -281,15 +280,7 @@ static int usb_serial_generic_write_start(struct usb_serial_port *port)
281 count = kfifo_out_locked(&port->write_fifo, data, port->bulk_out_size, &port->lock); 280 count = kfifo_out_locked(&port->write_fifo, data, port->bulk_out_size, &port->lock);
282 usb_serial_debug_data(debug, &port->dev, __func__, count, data); 281 usb_serial_debug_data(debug, &port->dev, __func__, count, data);
283 282
284 /* set up our urb */ 283 port->write_urb->transfer_buffer_length = count;
285 usb_fill_bulk_urb(port->write_urb, serial->dev,
286 usb_sndbulkpipe(serial->dev,
287 port->bulk_out_endpointAddress),
288 port->write_urb->transfer_buffer, count,
289 ((serial->type->write_bulk_callback) ?
290 serial->type->write_bulk_callback :
291 usb_serial_generic_write_bulk_callback),
292 port);
293 284
294 /* send the data out the bulk port */ 285 /* send the data out the bulk port */
295 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); 286 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
@@ -405,21 +396,9 @@ int usb_serial_generic_chars_in_buffer(struct tty_struct *tty)
405int usb_serial_generic_submit_read_urb(struct usb_serial_port *port, 396int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
406 gfp_t mem_flags) 397 gfp_t mem_flags)
407{ 398{
408 struct urb *urb = port->read_urb;
409 struct usb_serial *serial = port->serial;
410 int result; 399 int result;
411 400
412 /* Continue reading from device */ 401 result = usb_submit_urb(port->read_urb, mem_flags);
413 usb_fill_bulk_urb(urb, serial->dev,
414 usb_rcvbulkpipe(serial->dev,
415 port->bulk_in_endpointAddress),
416 urb->transfer_buffer,
417 urb->transfer_buffer_length,
418 ((serial->type->read_bulk_callback) ?
419 serial->type->read_bulk_callback :
420 usb_serial_generic_read_bulk_callback), port);
421
422 result = usb_submit_urb(urb, mem_flags);
423 if (result && result != -EPERM) { 402 if (result && result != -EPERM) {
424 dev_err(&port->dev, 403 dev_err(&port->dev,
425 "%s - failed submitting read urb, error %d\n", 404 "%s - failed submitting read urb, error %d\n",