aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2011-11-06 13:06:30 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-15 13:35:27 -0500
commitfd11961a2deaf4220ca90ce734439b4006db2911 (patch)
treef18e3a656eb93b01fe3238ba2b014add9a85b034
parentb7195188e9884f62efd96a3a91415418cb44381f (diff)
USB: serial: remove unnecessary bulk-urb re-fills
Remove unnecessary re-fills of bulk urbs whose fields have not changed since port probe. Compile-only tested. Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/usb/serial/cyberjack.c17
-rw-r--r--drivers/usb/serial/garmin_gps.c7
-rw-r--r--drivers/usb/serial/io_ti.c7
-rw-r--r--drivers/usb/serial/omninet.c12
4 files changed, 3 insertions, 40 deletions
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 2b220e811bf1..98bf83349838 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -207,7 +207,6 @@ static void cyberjack_close(struct usb_serial_port *port)
207static int cyberjack_write(struct tty_struct *tty, 207static int cyberjack_write(struct tty_struct *tty,
208 struct usb_serial_port *port, const unsigned char *buf, int count) 208 struct usb_serial_port *port, const unsigned char *buf, int count)
209{ 209{
210 struct usb_serial *serial = port->serial;
211 struct cyberjack_private *priv = usb_get_serial_port_data(port); 210 struct cyberjack_private *priv = usb_get_serial_port_data(port);
212 unsigned long flags; 211 unsigned long flags;
213 int result; 212 int result;
@@ -260,13 +259,7 @@ static int cyberjack_write(struct tty_struct *tty,
260 priv->wrsent = length; 259 priv->wrsent = length;
261 260
262 /* set up our urb */ 261 /* set up our urb */
263 usb_fill_bulk_urb(port->write_urb, serial->dev, 262 port->write_urb->transfer_buffer_length = length;
264 usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress),
265 port->write_urb->transfer_buffer, length,
266 ((serial->type->write_bulk_callback) ?
267 serial->type->write_bulk_callback :
268 cyberjack_write_bulk_callback),
269 port);
270 263
271 /* send the data out the bulk port */ 264 /* send the data out the bulk port */
272 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); 265 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
@@ -447,13 +440,7 @@ static void cyberjack_write_bulk_callback(struct urb *urb)
447 priv->wrsent += length; 440 priv->wrsent += length;
448 441
449 /* set up our urb */ 442 /* set up our urb */
450 usb_fill_bulk_urb(port->write_urb, port->serial->dev, 443 port->write_urb->transfer_buffer_length = length;
451 usb_sndbulkpipe(port->serial->dev, port->bulk_out_endpointAddress),
452 port->write_urb->transfer_buffer, length,
453 ((port->serial->type->write_bulk_callback) ?
454 port->serial->type->write_bulk_callback :
455 cyberjack_write_bulk_callback),
456 port);
457 444
458 /* send the data out the bulk port */ 445 /* send the data out the bulk port */
459 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); 446 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c
index d39da13d3dba..bf12565f8e87 100644
--- a/drivers/usb/serial/garmin_gps.c
+++ b/drivers/usb/serial/garmin_gps.c
@@ -1276,7 +1276,6 @@ static void garmin_read_int_callback(struct urb *urb)
1276 unsigned long flags; 1276 unsigned long flags;
1277 int retval; 1277 int retval;
1278 struct usb_serial_port *port = urb->context; 1278 struct usb_serial_port *port = urb->context;
1279 struct usb_serial *serial = port->serial;
1280 struct garmin_data *garmin_data_p = usb_get_serial_port_data(port); 1279 struct garmin_data *garmin_data_p = usb_get_serial_port_data(port);
1281 unsigned char *data = urb->transfer_buffer; 1280 unsigned char *data = urb->transfer_buffer;
1282 int status = urb->status; 1281 int status = urb->status;
@@ -1310,12 +1309,6 @@ static void garmin_read_int_callback(struct urb *urb)
1310 if (0 == (garmin_data_p->flags & FLAGS_BULK_IN_ACTIVE)) { 1309 if (0 == (garmin_data_p->flags & FLAGS_BULK_IN_ACTIVE)) {
1311 1310
1312 /* bulk data available */ 1311 /* bulk data available */
1313 usb_fill_bulk_urb(port->read_urb, serial->dev,
1314 usb_rcvbulkpipe(serial->dev,
1315 port->bulk_in_endpointAddress),
1316 port->read_urb->transfer_buffer,
1317 port->read_urb->transfer_buffer_length,
1318 garmin_read_bulk_callback, port);
1319 retval = usb_submit_urb(port->read_urb, GFP_ATOMIC); 1312 retval = usb_submit_urb(port->read_urb, GFP_ATOMIC);
1320 if (retval) { 1313 if (retval) {
1321 dev_err(&port->dev, 1314 dev_err(&port->dev,
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
index 589f11a0f7e2..e44d375edaad 100644
--- a/drivers/usb/serial/io_ti.c
+++ b/drivers/usb/serial/io_ti.c
@@ -2106,12 +2106,7 @@ static void edge_send(struct tty_struct *tty)
2106 port->write_urb->transfer_buffer); 2106 port->write_urb->transfer_buffer);
2107 2107
2108 /* set up our urb */ 2108 /* set up our urb */
2109 usb_fill_bulk_urb(port->write_urb, port->serial->dev, 2109 port->write_urb->transfer_buffer_length = count;
2110 usb_sndbulkpipe(port->serial->dev,
2111 port->bulk_out_endpointAddress),
2112 port->write_urb->transfer_buffer, count,
2113 edge_bulk_out_callback,
2114 port);
2115 2110
2116 /* send the data out the bulk port */ 2111 /* send the data out the bulk port */
2117 result = usb_submit_urb(port->write_urb, GFP_ATOMIC); 2112 result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index f3824641099a..45a8c55881d3 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -148,13 +148,6 @@ static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port)
148 tty_port_tty_set(&wport->port, tty); 148 tty_port_tty_set(&wport->port, tty);
149 149
150 /* Start reading from the device */ 150 /* Start reading from the device */
151 usb_fill_bulk_urb(port->read_urb, serial->dev,
152 usb_rcvbulkpipe(serial->dev,
153 port->bulk_in_endpointAddress),
154 port->read_urb->transfer_buffer,
155 port->read_urb->transfer_buffer_length,
156 omninet_read_bulk_callback, port);
157
158 result = usb_submit_urb(port->read_urb, GFP_KERNEL); 151 result = usb_submit_urb(port->read_urb, GFP_KERNEL);
159 if (result) 152 if (result)
160 dev_err(&port->dev, 153 dev_err(&port->dev,
@@ -211,11 +204,6 @@ static void omninet_read_bulk_callback(struct urb *urb)
211 } 204 }
212 205
213 /* Continue trying to always read */ 206 /* Continue trying to always read */
214 usb_fill_bulk_urb(urb, port->serial->dev,
215 usb_rcvbulkpipe(port->serial->dev,
216 port->bulk_in_endpointAddress),
217 urb->transfer_buffer, urb->transfer_buffer_length,
218 omninet_read_bulk_callback, port);
219 result = usb_submit_urb(urb, GFP_ATOMIC); 207 result = usb_submit_urb(urb, GFP_ATOMIC);
220 if (result) 208 if (result)
221 dev_err(&port->dev, 209 dev_err(&port->dev,