diff options
author | Johan Hovold <jhovold@gmail.com> | 2011-11-06 13:06:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-15 13:33:16 -0500 |
commit | 5833041f1b130e5823a99d03b14538282e5ad345 (patch) | |
tree | 394caf266125dd725d47470a11cb5840040130ec | |
parent | 016af7ec49836342c3b35166792c8d73a360571c (diff) |
USB: serial: remove unnecessary reinitialisations of urb->dev
Remove unnecessary reinitialisations of urb->dev before each submission,
which were based on the (no longer valid) assumption that serial->dev
will be set to NULL on close.
Compile-only tested.
Cc: Matthias Bruestle and Harald Welte <support@reiner-sct.com>
Cc: Lonnie Mendez <dignome@gmail.com>
Cc: Peter Berger <pberger@brimson.com>
Cc: Al Borchers <alborchers@steinerpoint.com>
Cc: Support Department <support@connecttech.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/ch341.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/cyberjack.c | 4 | ||||
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 11 | ||||
-rw-r--r-- | drivers/usb/serial/garmin_gps.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/io_ti.c | 10 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan.c | 23 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan_pda.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/kobil_sct.c | 13 | ||||
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/mos7720.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/mos7840.c | 4 | ||||
-rw-r--r-- | drivers/usb/serial/omninet.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/opticon.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/oti6858.c | 9 | ||||
-rw-r--r-- | drivers/usb/serial/sierra.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/symbolserial.c | 1 | ||||
-rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 10 | ||||
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 7 |
20 files changed, 8 insertions, 107 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c index 6ae1c0688b5e..8607f1522ef3 100644 --- a/drivers/usb/serial/ch341.c +++ b/drivers/usb/serial/ch341.c | |||
@@ -335,7 +335,6 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
335 | goto out; | 335 | goto out; |
336 | 336 | ||
337 | dbg("%s - submitting interrupt urb", __func__); | 337 | dbg("%s - submitting interrupt urb", __func__); |
338 | port->interrupt_in_urb->dev = serial->dev; | ||
339 | r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 338 | r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
340 | if (r) { | 339 | if (r) { |
341 | dev_err(&port->dev, "%s - failed submitting interrupt urb," | 340 | dev_err(&port->dev, "%s - failed submitting interrupt urb," |
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 5a41252807cb..2b220e811bf1 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c | |||
@@ -138,7 +138,6 @@ static int cyberjack_startup(struct usb_serial *serial) | |||
138 | 138 | ||
139 | for (i = 0; i < serial->num_ports; ++i) { | 139 | for (i = 0; i < serial->num_ports; ++i) { |
140 | int result; | 140 | int result; |
141 | serial->port[i]->interrupt_in_urb->dev = serial->dev; | ||
142 | result = usb_submit_urb(serial->port[i]->interrupt_in_urb, | 141 | result = usb_submit_urb(serial->port[i]->interrupt_in_urb, |
143 | GFP_KERNEL); | 142 | GFP_KERNEL); |
144 | if (result) | 143 | if (result) |
@@ -347,7 +346,6 @@ static void cyberjack_read_int_callback(struct urb *urb) | |||
347 | spin_unlock(&priv->lock); | 346 | spin_unlock(&priv->lock); |
348 | 347 | ||
349 | if (!old_rdtodo) { | 348 | if (!old_rdtodo) { |
350 | port->read_urb->dev = port->serial->dev; | ||
351 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 349 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
352 | if (result) | 350 | if (result) |
353 | dev_err(&port->dev, "%s - failed resubmitting " | 351 | dev_err(&port->dev, "%s - failed resubmitting " |
@@ -358,7 +356,6 @@ static void cyberjack_read_int_callback(struct urb *urb) | |||
358 | } | 356 | } |
359 | 357 | ||
360 | resubmit: | 358 | resubmit: |
361 | port->interrupt_in_urb->dev = port->serial->dev; | ||
362 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); | 359 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); |
363 | if (result) | 360 | if (result) |
364 | dev_err(&port->dev, "usb_submit_urb(read int) failed\n"); | 361 | dev_err(&port->dev, "usb_submit_urb(read int) failed\n"); |
@@ -411,7 +408,6 @@ static void cyberjack_read_bulk_callback(struct urb *urb) | |||
411 | 408 | ||
412 | /* Continue to read if we have still urbs to do. */ | 409 | /* Continue to read if we have still urbs to do. */ |
413 | if (todo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/) { | 410 | if (todo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/) { |
414 | port->read_urb->dev = port->serial->dev; | ||
415 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 411 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
416 | if (result) | 412 | if (result) |
417 | dev_err(&port->dev, "%s - failed resubmitting read " | 413 | dev_err(&port->dev, "%s - failed resubmitting read " |
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index b20440e58d8f..07680d6b792b 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -1136,8 +1136,6 @@ static void cypress_unthrottle(struct tty_struct *tty) | |||
1136 | return; | 1136 | return; |
1137 | 1137 | ||
1138 | if (actually_throttled) { | 1138 | if (actually_throttled) { |
1139 | port->interrupt_in_urb->dev = port->serial->dev; | ||
1140 | |||
1141 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 1139 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
1142 | if (result) { | 1140 | if (result) { |
1143 | dev_err(&port->dev, "%s - failed submitting read urb, " | 1141 | dev_err(&port->dev, "%s - failed submitting read urb, " |
@@ -1326,7 +1324,6 @@ static void cypress_write_int_callback(struct urb *urb) | |||
1326 | dbg("%s - nonzero write bulk status received: %d", | 1324 | dbg("%s - nonzero write bulk status received: %d", |
1327 | __func__, status); | 1325 | __func__, status); |
1328 | port->interrupt_out_urb->transfer_buffer_length = 1; | 1326 | port->interrupt_out_urb->transfer_buffer_length = 1; |
1329 | port->interrupt_out_urb->dev = port->serial->dev; | ||
1330 | result = usb_submit_urb(port->interrupt_out_urb, GFP_ATOMIC); | 1327 | result = usb_submit_urb(port->interrupt_out_urb, GFP_ATOMIC); |
1331 | if (!result) | 1328 | if (!result) |
1332 | return; | 1329 | return; |
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 3786e9544ae0..6d26a77d0f2a 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c | |||
@@ -438,7 +438,6 @@ static int digi_write_oob_command(struct usb_serial_port *port, | |||
438 | len &= ~3; | 438 | len &= ~3; |
439 | memcpy(oob_port->write_urb->transfer_buffer, buf, len); | 439 | memcpy(oob_port->write_urb->transfer_buffer, buf, len); |
440 | oob_port->write_urb->transfer_buffer_length = len; | 440 | oob_port->write_urb->transfer_buffer_length = len; |
441 | oob_port->write_urb->dev = port->serial->dev; | ||
442 | ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC); | 441 | ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC); |
443 | if (ret == 0) { | 442 | if (ret == 0) { |
444 | oob_priv->dp_write_urb_in_use = 1; | 443 | oob_priv->dp_write_urb_in_use = 1; |
@@ -516,7 +515,6 @@ static int digi_write_inb_command(struct usb_serial_port *port, | |||
516 | memcpy(data, buf, len); | 515 | memcpy(data, buf, len); |
517 | port->write_urb->transfer_buffer_length = len; | 516 | port->write_urb->transfer_buffer_length = len; |
518 | } | 517 | } |
519 | port->write_urb->dev = port->serial->dev; | ||
520 | 518 | ||
521 | ret = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 519 | ret = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
522 | if (ret == 0) { | 520 | if (ret == 0) { |
@@ -587,7 +585,6 @@ static int digi_set_modem_signals(struct usb_serial_port *port, | |||
587 | data[7] = 0; | 585 | data[7] = 0; |
588 | 586 | ||
589 | oob_port->write_urb->transfer_buffer_length = 8; | 587 | oob_port->write_urb->transfer_buffer_length = 8; |
590 | oob_port->write_urb->dev = port->serial->dev; | ||
591 | 588 | ||
592 | ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC); | 589 | ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC); |
593 | if (ret == 0) { | 590 | if (ret == 0) { |
@@ -683,10 +680,8 @@ static void digi_rx_unthrottle(struct tty_struct *tty) | |||
683 | spin_lock_irqsave(&priv->dp_port_lock, flags); | 680 | spin_lock_irqsave(&priv->dp_port_lock, flags); |
684 | 681 | ||
685 | /* restart read chain */ | 682 | /* restart read chain */ |
686 | if (priv->dp_throttle_restart) { | 683 | if (priv->dp_throttle_restart) |
687 | port->read_urb->dev = port->serial->dev; | ||
688 | ret = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 684 | ret = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
689 | } | ||
690 | 685 | ||
691 | /* turn throttle off */ | 686 | /* turn throttle off */ |
692 | priv->dp_throttled = 0; | 687 | priv->dp_throttled = 0; |
@@ -979,7 +974,6 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
979 | } | 974 | } |
980 | 975 | ||
981 | port->write_urb->transfer_buffer_length = data_len+2; | 976 | port->write_urb->transfer_buffer_length = data_len+2; |
982 | port->write_urb->dev = port->serial->dev; | ||
983 | 977 | ||
984 | *data++ = DIGI_CMD_SEND_DATA; | 978 | *data++ = DIGI_CMD_SEND_DATA; |
985 | *data++ = data_len; | 979 | *data++ = data_len; |
@@ -1055,7 +1049,6 @@ static void digi_write_bulk_callback(struct urb *urb) | |||
1055 | = (unsigned char)priv->dp_out_buf_len; | 1049 | = (unsigned char)priv->dp_out_buf_len; |
1056 | port->write_urb->transfer_buffer_length = | 1050 | port->write_urb->transfer_buffer_length = |
1057 | priv->dp_out_buf_len + 2; | 1051 | priv->dp_out_buf_len + 2; |
1058 | port->write_urb->dev = serial->dev; | ||
1059 | memcpy(port->write_urb->transfer_buffer + 2, priv->dp_out_buf, | 1052 | memcpy(port->write_urb->transfer_buffer + 2, priv->dp_out_buf, |
1060 | priv->dp_out_buf_len); | 1053 | priv->dp_out_buf_len); |
1061 | ret = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 1054 | ret = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
@@ -1257,7 +1250,6 @@ static int digi_startup_device(struct usb_serial *serial) | |||
1257 | /* set USB_DISABLE_SPD flag for write bulk urbs */ | 1250 | /* set USB_DISABLE_SPD flag for write bulk urbs */ |
1258 | for (i = 0; i < serial->type->num_ports + 1; i++) { | 1251 | for (i = 0; i < serial->type->num_ports + 1; i++) { |
1259 | port = serial->port[i]; | 1252 | port = serial->port[i]; |
1260 | port->write_urb->dev = port->serial->dev; | ||
1261 | ret = usb_submit_urb(port->read_urb, GFP_KERNEL); | 1253 | ret = usb_submit_urb(port->read_urb, GFP_KERNEL); |
1262 | if (ret != 0) { | 1254 | if (ret != 0) { |
1263 | dev_err(&port->dev, | 1255 | dev_err(&port->dev, |
@@ -1400,7 +1392,6 @@ static void digi_read_bulk_callback(struct urb *urb) | |||
1400 | } | 1392 | } |
1401 | 1393 | ||
1402 | /* continue read */ | 1394 | /* continue read */ |
1403 | urb->dev = port->serial->dev; | ||
1404 | ret = usb_submit_urb(urb, GFP_ATOMIC); | 1395 | ret = usb_submit_urb(urb, GFP_ATOMIC); |
1405 | if (ret != 0 && ret != -EPERM) { | 1396 | if (ret != 0 && ret != -EPERM) { |
1406 | dev_err(&port->dev, | 1397 | dev_err(&port->dev, |
diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c index 1a49ca9c8ea5..d39da13d3dba 100644 --- a/drivers/usb/serial/garmin_gps.c +++ b/drivers/usb/serial/garmin_gps.c | |||
@@ -901,7 +901,6 @@ static int garmin_init_session(struct usb_serial_port *port) | |||
901 | usb_kill_urb(port->interrupt_in_urb); | 901 | usb_kill_urb(port->interrupt_in_urb); |
902 | 902 | ||
903 | dbg("%s - adding interrupt input", __func__); | 903 | dbg("%s - adding interrupt input", __func__); |
904 | port->interrupt_in_urb->dev = serial->dev; | ||
905 | status = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 904 | status = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
906 | if (status) | 905 | if (status) |
907 | dev_err(&serial->dev->dev, | 906 | dev_err(&serial->dev->dev, |
@@ -1353,7 +1352,6 @@ static void garmin_read_int_callback(struct urb *urb) | |||
1353 | 1352 | ||
1354 | garmin_read_process(garmin_data_p, data, urb->actual_length, 0); | 1353 | garmin_read_process(garmin_data_p, data, urb->actual_length, 0); |
1355 | 1354 | ||
1356 | port->interrupt_in_urb->dev = port->serial->dev; | ||
1357 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 1355 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
1358 | if (retval) | 1356 | if (retval) |
1359 | dev_err(&urb->dev->dev, | 1357 | dev_err(&urb->dev->dev, |
diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index 2ee807523f53..abd2ee2b2f99 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c | |||
@@ -610,7 +610,6 @@ static void edge_interrupt_callback(struct urb *urb) | |||
610 | 610 | ||
611 | /* we have pending bytes on the | 611 | /* we have pending bytes on the |
612 | bulk in pipe, send a request */ | 612 | bulk in pipe, send a request */ |
613 | edge_serial->read_urb->dev = edge_serial->serial->dev; | ||
614 | result = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); | 613 | result = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); |
615 | if (result) { | 614 | if (result) { |
616 | dev_err(&edge_serial->serial->dev->dev, "%s - usb_submit_urb(read bulk) failed with result = %d\n", __func__, result); | 615 | dev_err(&edge_serial->serial->dev->dev, "%s - usb_submit_urb(read bulk) failed with result = %d\n", __func__, result); |
@@ -711,7 +710,6 @@ static void edge_bulk_in_callback(struct urb *urb) | |||
711 | /* check to see if there's any more data for us to read */ | 710 | /* check to see if there's any more data for us to read */ |
712 | if (edge_serial->rxBytesAvail > 0) { | 711 | if (edge_serial->rxBytesAvail > 0) { |
713 | dbg("%s - posting a read", __func__); | 712 | dbg("%s - posting a read", __func__); |
714 | edge_serial->read_urb->dev = edge_serial->serial->dev; | ||
715 | retval = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); | 713 | retval = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC); |
716 | if (retval) { | 714 | if (retval) { |
717 | dev_err(&urb->dev->dev, | 715 | dev_err(&urb->dev->dev, |
@@ -1330,7 +1328,6 @@ static void send_more_port_data(struct edgeport_serial *edge_serial, | |||
1330 | edge_port->txCredits -= count; | 1328 | edge_port->txCredits -= count; |
1331 | edge_port->icount.tx += count; | 1329 | edge_port->icount.tx += count; |
1332 | 1330 | ||
1333 | urb->dev = edge_serial->serial->dev; | ||
1334 | status = usb_submit_urb(urb, GFP_ATOMIC); | 1331 | status = usb_submit_urb(urb, GFP_ATOMIC); |
1335 | if (status) { | 1332 | if (status) { |
1336 | /* something went wrong */ | 1333 | /* something went wrong */ |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index e42ddfc02aaa..29fba8ccf8e2 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -1770,12 +1770,11 @@ static void edge_bulk_in_callback(struct urb *urb) | |||
1770 | exit: | 1770 | exit: |
1771 | /* continue read unless stopped */ | 1771 | /* continue read unless stopped */ |
1772 | spin_lock(&edge_port->ep_lock); | 1772 | spin_lock(&edge_port->ep_lock); |
1773 | if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) { | 1773 | if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) |
1774 | urb->dev = edge_port->port->serial->dev; | ||
1775 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 1774 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
1776 | } else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) { | 1775 | else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) |
1777 | edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED; | 1776 | edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED; |
1778 | } | 1777 | |
1779 | spin_unlock(&edge_port->ep_lock); | 1778 | spin_unlock(&edge_port->ep_lock); |
1780 | if (retval) | 1779 | if (retval) |
1781 | dev_err(&urb->dev->dev, | 1780 | dev_err(&urb->dev->dev, |
@@ -1954,7 +1953,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
1954 | } | 1953 | } |
1955 | urb->complete = edge_interrupt_callback; | 1954 | urb->complete = edge_interrupt_callback; |
1956 | urb->context = edge_serial; | 1955 | urb->context = edge_serial; |
1957 | urb->dev = dev; | ||
1958 | status = usb_submit_urb(urb, GFP_KERNEL); | 1956 | status = usb_submit_urb(urb, GFP_KERNEL); |
1959 | if (status) { | 1957 | if (status) { |
1960 | dev_err(&port->dev, | 1958 | dev_err(&port->dev, |
@@ -1982,7 +1980,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
1982 | edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING; | 1980 | edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING; |
1983 | urb->complete = edge_bulk_in_callback; | 1981 | urb->complete = edge_bulk_in_callback; |
1984 | urb->context = edge_port; | 1982 | urb->context = edge_port; |
1985 | urb->dev = dev; | ||
1986 | status = usb_submit_urb(urb, GFP_KERNEL); | 1983 | status = usb_submit_urb(urb, GFP_KERNEL); |
1987 | if (status) { | 1984 | if (status) { |
1988 | dev_err(&port->dev, | 1985 | dev_err(&port->dev, |
@@ -2262,7 +2259,6 @@ static int restart_read(struct edgeport_port *edge_port) | |||
2262 | urb = edge_port->port->read_urb; | 2259 | urb = edge_port->port->read_urb; |
2263 | urb->complete = edge_bulk_in_callback; | 2260 | urb->complete = edge_bulk_in_callback; |
2264 | urb->context = edge_port; | 2261 | urb->context = edge_port; |
2265 | urb->dev = edge_port->port->serial->dev; | ||
2266 | status = usb_submit_urb(urb, GFP_ATOMIC); | 2262 | status = usb_submit_urb(urb, GFP_ATOMIC); |
2267 | } | 2263 | } |
2268 | edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING; | 2264 | edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING; |
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 65356620c253..bc8dc203e818 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -330,7 +330,6 @@ static int keyspan_write(struct tty_struct *tty, | |||
330 | /* send the data out the bulk port */ | 330 | /* send the data out the bulk port */ |
331 | this_urb->transfer_buffer_length = todo + dataOffset; | 331 | this_urb->transfer_buffer_length = todo + dataOffset; |
332 | 332 | ||
333 | this_urb->dev = port->serial->dev; | ||
334 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 333 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
335 | if (err != 0) | 334 | if (err != 0) |
336 | dbg("usb_submit_urb(write bulk) failed (%d)", err); | 335 | dbg("usb_submit_urb(write bulk) failed (%d)", err); |
@@ -396,7 +395,6 @@ static void usa26_indat_callback(struct urb *urb) | |||
396 | tty_kref_put(tty); | 395 | tty_kref_put(tty); |
397 | 396 | ||
398 | /* Resubmit urb so we continue receiving */ | 397 | /* Resubmit urb so we continue receiving */ |
399 | urb->dev = port->serial->dev; | ||
400 | err = usb_submit_urb(urb, GFP_ATOMIC); | 398 | err = usb_submit_urb(urb, GFP_ATOMIC); |
401 | if (err != 0) | 399 | if (err != 0) |
402 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 400 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -492,7 +490,6 @@ static void usa26_instat_callback(struct urb *urb) | |||
492 | } | 490 | } |
493 | 491 | ||
494 | /* Resubmit urb so we continue receiving */ | 492 | /* Resubmit urb so we continue receiving */ |
495 | urb->dev = serial->dev; | ||
496 | err = usb_submit_urb(urb, GFP_ATOMIC); | 493 | err = usb_submit_urb(urb, GFP_ATOMIC); |
497 | if (err != 0) | 494 | if (err != 0) |
498 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 495 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -542,7 +539,6 @@ static void usa28_indat_callback(struct urb *urb) | |||
542 | tty_kref_put(tty); | 539 | tty_kref_put(tty); |
543 | 540 | ||
544 | /* Resubmit urb so we continue receiving */ | 541 | /* Resubmit urb so we continue receiving */ |
545 | urb->dev = port->serial->dev; | ||
546 | err = usb_submit_urb(urb, GFP_ATOMIC); | 542 | err = usb_submit_urb(urb, GFP_ATOMIC); |
547 | if (err != 0) | 543 | if (err != 0) |
548 | dbg("%s - resubmit read urb failed. (%d)", | 544 | dbg("%s - resubmit read urb failed. (%d)", |
@@ -627,7 +623,6 @@ static void usa28_instat_callback(struct urb *urb) | |||
627 | } | 623 | } |
628 | 624 | ||
629 | /* Resubmit urb so we continue receiving */ | 625 | /* Resubmit urb so we continue receiving */ |
630 | urb->dev = serial->dev; | ||
631 | err = usb_submit_urb(urb, GFP_ATOMIC); | 626 | err = usb_submit_urb(urb, GFP_ATOMIC); |
632 | if (err != 0) | 627 | if (err != 0) |
633 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 628 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -722,8 +717,6 @@ static void usa49_instat_callback(struct urb *urb) | |||
722 | } | 717 | } |
723 | 718 | ||
724 | /* Resubmit urb so we continue receiving */ | 719 | /* Resubmit urb so we continue receiving */ |
725 | urb->dev = serial->dev; | ||
726 | |||
727 | err = usb_submit_urb(urb, GFP_ATOMIC); | 720 | err = usb_submit_urb(urb, GFP_ATOMIC); |
728 | if (err != 0) | 721 | if (err != 0) |
729 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 722 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -781,7 +774,6 @@ static void usa49_indat_callback(struct urb *urb) | |||
781 | tty_kref_put(tty); | 774 | tty_kref_put(tty); |
782 | 775 | ||
783 | /* Resubmit urb so we continue receiving */ | 776 | /* Resubmit urb so we continue receiving */ |
784 | urb->dev = port->serial->dev; | ||
785 | err = usb_submit_urb(urb, GFP_ATOMIC); | 777 | err = usb_submit_urb(urb, GFP_ATOMIC); |
786 | if (err != 0) | 778 | if (err != 0) |
787 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 779 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -852,8 +844,6 @@ static void usa49wg_indat_callback(struct urb *urb) | |||
852 | } | 844 | } |
853 | 845 | ||
854 | /* Resubmit urb so we continue receiving */ | 846 | /* Resubmit urb so we continue receiving */ |
855 | urb->dev = serial->dev; | ||
856 | |||
857 | err = usb_submit_urb(urb, GFP_ATOMIC); | 847 | err = usb_submit_urb(urb, GFP_ATOMIC); |
858 | if (err != 0) | 848 | if (err != 0) |
859 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 849 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -929,7 +919,6 @@ static void usa90_indat_callback(struct urb *urb) | |||
929 | } | 919 | } |
930 | 920 | ||
931 | /* Resubmit urb so we continue receiving */ | 921 | /* Resubmit urb so we continue receiving */ |
932 | urb->dev = port->serial->dev; | ||
933 | err = usb_submit_urb(urb, GFP_ATOMIC); | 922 | err = usb_submit_urb(urb, GFP_ATOMIC); |
934 | if (err != 0) | 923 | if (err != 0) |
935 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 924 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -980,7 +969,6 @@ static void usa90_instat_callback(struct urb *urb) | |||
980 | } | 969 | } |
981 | 970 | ||
982 | /* Resubmit urb so we continue receiving */ | 971 | /* Resubmit urb so we continue receiving */ |
983 | urb->dev = serial->dev; | ||
984 | err = usb_submit_urb(urb, GFP_ATOMIC); | 972 | err = usb_submit_urb(urb, GFP_ATOMIC); |
985 | if (err != 0) | 973 | if (err != 0) |
986 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 974 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -1056,7 +1044,6 @@ static void usa67_instat_callback(struct urb *urb) | |||
1056 | } | 1044 | } |
1057 | 1045 | ||
1058 | /* Resubmit urb so we continue receiving */ | 1046 | /* Resubmit urb so we continue receiving */ |
1059 | urb->dev = serial->dev; | ||
1060 | err = usb_submit_urb(urb, GFP_ATOMIC); | 1047 | err = usb_submit_urb(urb, GFP_ATOMIC); |
1061 | if (err != 0) | 1048 | if (err != 0) |
1062 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); | 1049 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
@@ -1156,7 +1143,6 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
1156 | urb = p_priv->in_urbs[i]; | 1143 | urb = p_priv->in_urbs[i]; |
1157 | if (urb == NULL) | 1144 | if (urb == NULL) |
1158 | continue; | 1145 | continue; |
1159 | urb->dev = serial->dev; | ||
1160 | 1146 | ||
1161 | /* make sure endpoint data toggle is synchronized | 1147 | /* make sure endpoint data toggle is synchronized |
1162 | with the device */ | 1148 | with the device */ |
@@ -1172,7 +1158,6 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
1172 | urb = p_priv->out_urbs[i]; | 1158 | urb = p_priv->out_urbs[i]; |
1173 | if (urb == NULL) | 1159 | if (urb == NULL) |
1174 | continue; | 1160 | continue; |
1175 | urb->dev = serial->dev; | ||
1176 | /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), | 1161 | /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), |
1177 | usb_pipeout(urb->pipe), 0); */ | 1162 | usb_pipeout(urb->pipe), 0); */ |
1178 | } | 1163 | } |
@@ -1889,7 +1874,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1889 | /* send the data out the device on control endpoint */ | 1874 | /* send the data out the device on control endpoint */ |
1890 | this_urb->transfer_buffer_length = sizeof(msg); | 1875 | this_urb->transfer_buffer_length = sizeof(msg); |
1891 | 1876 | ||
1892 | this_urb->dev = serial->dev; | ||
1893 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 1877 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
1894 | if (err != 0) | 1878 | if (err != 0) |
1895 | dbg("%s - usb_submit_urb(setup) failed (%d)", __func__, err); | 1879 | dbg("%s - usb_submit_urb(setup) failed (%d)", __func__, err); |
@@ -2017,7 +2001,6 @@ static int keyspan_usa28_send_setup(struct usb_serial *serial, | |||
2017 | /* send the data out the device on control endpoint */ | 2001 | /* send the data out the device on control endpoint */ |
2018 | this_urb->transfer_buffer_length = sizeof(msg); | 2002 | this_urb->transfer_buffer_length = sizeof(msg); |
2019 | 2003 | ||
2020 | this_urb->dev = serial->dev; | ||
2021 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 2004 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
2022 | if (err != 0) | 2005 | if (err != 0) |
2023 | dbg("%s - usb_submit_urb(setup) failed", __func__); | 2006 | dbg("%s - usb_submit_urb(setup) failed", __func__); |
@@ -2204,8 +2187,6 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial, | |||
2204 | 2187 | ||
2205 | /* send the data out the device on control endpoint */ | 2188 | /* send the data out the device on control endpoint */ |
2206 | this_urb->transfer_buffer_length = sizeof(msg); | 2189 | this_urb->transfer_buffer_length = sizeof(msg); |
2207 | |||
2208 | this_urb->dev = serial->dev; | ||
2209 | } | 2190 | } |
2210 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 2191 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
2211 | if (err != 0) | 2192 | if (err != 0) |
@@ -2348,7 +2329,6 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial, | |||
2348 | /* send the data out the device on control endpoint */ | 2329 | /* send the data out the device on control endpoint */ |
2349 | this_urb->transfer_buffer_length = sizeof(msg); | 2330 | this_urb->transfer_buffer_length = sizeof(msg); |
2350 | 2331 | ||
2351 | this_urb->dev = serial->dev; | ||
2352 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 2332 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
2353 | if (err != 0) | 2333 | if (err != 0) |
2354 | dbg("%s - usb_submit_urb(setup) failed (%d)", __func__, err); | 2334 | dbg("%s - usb_submit_urb(setup) failed (%d)", __func__, err); |
@@ -2494,7 +2474,6 @@ static int keyspan_usa67_send_setup(struct usb_serial *serial, | |||
2494 | 2474 | ||
2495 | /* send the data out the device on control endpoint */ | 2475 | /* send the data out the device on control endpoint */ |
2496 | this_urb->transfer_buffer_length = sizeof(msg); | 2476 | this_urb->transfer_buffer_length = sizeof(msg); |
2497 | this_urb->dev = serial->dev; | ||
2498 | 2477 | ||
2499 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 2478 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
2500 | if (err != 0) | 2479 | if (err != 0) |
@@ -2583,14 +2562,12 @@ static int keyspan_startup(struct usb_serial *serial) | |||
2583 | keyspan_setup_urbs(serial); | 2562 | keyspan_setup_urbs(serial); |
2584 | 2563 | ||
2585 | if (s_priv->instat_urb != NULL) { | 2564 | if (s_priv->instat_urb != NULL) { |
2586 | s_priv->instat_urb->dev = serial->dev; | ||
2587 | err = usb_submit_urb(s_priv->instat_urb, GFP_KERNEL); | 2565 | err = usb_submit_urb(s_priv->instat_urb, GFP_KERNEL); |
2588 | if (err != 0) | 2566 | if (err != 0) |
2589 | dbg("%s - submit instat urb failed %d", __func__, | 2567 | dbg("%s - submit instat urb failed %d", __func__, |
2590 | err); | 2568 | err); |
2591 | } | 2569 | } |
2592 | if (s_priv->indat_urb != NULL) { | 2570 | if (s_priv->indat_urb != NULL) { |
2593 | s_priv->indat_urb->dev = serial->dev; | ||
2594 | err = usb_submit_urb(s_priv->indat_urb, GFP_KERNEL); | 2571 | err = usb_submit_urb(s_priv->indat_urb, GFP_KERNEL); |
2595 | if (err != 0) | 2572 | if (err != 0) |
2596 | dbg("%s - submit indat urb failed %d", __func__, | 2573 | dbg("%s - submit indat urb failed %d", __func__, |
diff --git a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c index 9428cc0cfb12..a40615674a68 100644 --- a/drivers/usb/serial/keyspan_pda.c +++ b/drivers/usb/serial/keyspan_pda.c | |||
@@ -237,7 +237,6 @@ static void keyspan_pda_rx_unthrottle(struct tty_struct *tty) | |||
237 | struct usb_serial_port *port = tty->driver_data; | 237 | struct usb_serial_port *port = tty->driver_data; |
238 | /* just restart the receive interrupt URB */ | 238 | /* just restart the receive interrupt URB */ |
239 | dbg("keyspan_pda_rx_unthrottle port %d", port->number); | 239 | dbg("keyspan_pda_rx_unthrottle port %d", port->number); |
240 | port->interrupt_in_urb->dev = port->serial->dev; | ||
241 | if (usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL)) | 240 | if (usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL)) |
242 | dbg(" usb_submit_urb(read urb) failed"); | 241 | dbg(" usb_submit_urb(read urb) failed"); |
243 | } | 242 | } |
@@ -545,7 +544,6 @@ static int keyspan_pda_write(struct tty_struct *tty, | |||
545 | 544 | ||
546 | priv->tx_room -= count; | 545 | priv->tx_room -= count; |
547 | 546 | ||
548 | port->write_urb->dev = port->serial->dev; | ||
549 | rc = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 547 | rc = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
550 | if (rc) { | 548 | if (rc) { |
551 | dbg(" usb_submit_urb(write bulk) failed"); | 549 | dbg(" usb_submit_urb(write bulk) failed"); |
@@ -664,7 +662,6 @@ static int keyspan_pda_open(struct tty_struct *tty, | |||
664 | priv->tx_throttled = *room ? 0 : 1; | 662 | priv->tx_throttled = *room ? 0 : 1; |
665 | 663 | ||
666 | /*Start reading from the device*/ | 664 | /*Start reading from the device*/ |
667 | port->interrupt_in_urb->dev = serial->dev; | ||
668 | rc = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 665 | rc = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
669 | if (rc) { | 666 | if (rc) { |
670 | dbg("%s - usb_submit_urb(read int) failed", __func__); | 667 | dbg("%s - usb_submit_urb(read int) failed", __func__); |
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 2ecfc0101a4c..5d3beeeb5fd9 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -219,9 +219,6 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
219 | dbg("%s - port %d", __func__, port->number); | 219 | dbg("%s - port %d", __func__, port->number); |
220 | priv = usb_get_serial_port_data(port); | 220 | priv = usb_get_serial_port_data(port); |
221 | 221 | ||
222 | /* someone sets the dev to 0 if the close method has been called */ | ||
223 | port->interrupt_in_urb->dev = port->serial->dev; | ||
224 | |||
225 | /* allocate memory for transfer buffer */ | 222 | /* allocate memory for transfer buffer */ |
226 | transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL); | 223 | transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL); |
227 | if (!transfer_buffer) | 224 | if (!transfer_buffer) |
@@ -381,8 +378,6 @@ static void kobil_read_int_callback(struct urb *urb) | |||
381 | tty_flip_buffer_push(tty); | 378 | tty_flip_buffer_push(tty); |
382 | } | 379 | } |
383 | tty_kref_put(tty); | 380 | tty_kref_put(tty); |
384 | /* someone sets the dev to 0 if the close method has been called */ | ||
385 | port->interrupt_in_urb->dev = port->serial->dev; | ||
386 | 381 | ||
387 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); | 382 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); |
388 | dbg("%s - port %d Send read URB returns: %i", | 383 | dbg("%s - port %d Send read URB returns: %i", |
@@ -463,17 +458,9 @@ static int kobil_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
463 | priv->filled = 0; | 458 | priv->filled = 0; |
464 | priv->cur_pos = 0; | 459 | priv->cur_pos = 0; |
465 | 460 | ||
466 | /* someone sets the dev to 0 if the close method | ||
467 | has been called */ | ||
468 | port->interrupt_in_urb->dev = port->serial->dev; | ||
469 | |||
470 | /* start reading (except TWIN and KAAN SIM) */ | 461 | /* start reading (except TWIN and KAAN SIM) */ |
471 | if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID || | 462 | if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID || |
472 | priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) { | 463 | priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) { |
473 | /* someone sets the dev to 0 if the close method has | ||
474 | been called */ | ||
475 | port->interrupt_in_urb->dev = port->serial->dev; | ||
476 | |||
477 | result = usb_submit_urb(port->interrupt_in_urb, | 464 | result = usb_submit_urb(port->interrupt_in_urb, |
478 | GFP_NOIO); | 465 | GFP_NOIO); |
479 | dbg("%s - port %d Send read URB returns: %i", | 466 | dbg("%s - port %d Send read URB returns: %i", |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 6804efeb9456..a975bb80303f 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -482,7 +482,6 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
482 | mct_u232_msr_to_state(&priv->control_state, priv->last_msr); | 482 | mct_u232_msr_to_state(&priv->control_state, priv->last_msr); |
483 | spin_unlock_irqrestore(&priv->lock, flags); | 483 | spin_unlock_irqrestore(&priv->lock, flags); |
484 | 484 | ||
485 | port->read_urb->dev = port->serial->dev; | ||
486 | retval = usb_submit_urb(port->read_urb, GFP_KERNEL); | 485 | retval = usb_submit_urb(port->read_urb, GFP_KERNEL); |
487 | if (retval) { | 486 | if (retval) { |
488 | dev_err(&port->dev, | 487 | dev_err(&port->dev, |
@@ -491,7 +490,6 @@ static int mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
491 | goto error; | 490 | goto error; |
492 | } | 491 | } |
493 | 492 | ||
494 | port->interrupt_in_urb->dev = port->serial->dev; | ||
495 | retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 493 | retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
496 | if (retval) { | 494 | if (retval) { |
497 | usb_kill_urb(port->read_urb); | 495 | usb_kill_urb(port->read_urb); |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 51b56b0c4228..19d112f51b97 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -940,8 +940,6 @@ static void mos7720_bulk_in_callback(struct urb *urb) | |||
940 | tty_kref_put(tty); | 940 | tty_kref_put(tty); |
941 | 941 | ||
942 | if (port->read_urb->status != -EINPROGRESS) { | 942 | if (port->read_urb->status != -EINPROGRESS) { |
943 | port->read_urb->dev = port->serial->dev; | ||
944 | |||
945 | retval = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 943 | retval = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
946 | if (retval) | 944 | if (retval) |
947 | dbg("usb_submit_urb(read bulk) failed, retval = %d", | 945 | dbg("usb_submit_urb(read bulk) failed, retval = %d", |
@@ -1727,8 +1725,6 @@ static void change_port_settings(struct tty_struct *tty, | |||
1727 | write_mos_reg(serial, port_number, IER, 0x0c); | 1725 | write_mos_reg(serial, port_number, IER, 0x0c); |
1728 | 1726 | ||
1729 | if (port->read_urb->status != -EINPROGRESS) { | 1727 | if (port->read_urb->status != -EINPROGRESS) { |
1730 | port->read_urb->dev = serial->dev; | ||
1731 | |||
1732 | status = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 1728 | status = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
1733 | if (status) | 1729 | if (status) |
1734 | dbg("usb_submit_urb(read bulk) failed, status = %d", | 1730 | dbg("usb_submit_urb(read bulk) failed, status = %d", |
@@ -1779,7 +1775,6 @@ static void mos7720_set_termios(struct tty_struct *tty, | |||
1779 | change_port_settings(tty, mos7720_port, old_termios); | 1775 | change_port_settings(tty, mos7720_port, old_termios); |
1780 | 1776 | ||
1781 | if (port->read_urb->status != -EINPROGRESS) { | 1777 | if (port->read_urb->status != -EINPROGRESS) { |
1782 | port->read_urb->dev = serial->dev; | ||
1783 | status = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 1778 | status = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
1784 | if (status) | 1779 | if (status) |
1785 | dbg("usb_submit_urb(read bulk) failed, status = %d", | 1780 | dbg("usb_submit_urb(read bulk) failed, status = %d", |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index c72abd524983..55cfd6265b98 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -792,8 +792,6 @@ static void mos7840_bulk_in_callback(struct urb *urb) | |||
792 | } | 792 | } |
793 | 793 | ||
794 | 794 | ||
795 | mos7840_port->read_urb->dev = serial->dev; | ||
796 | |||
797 | mos7840_port->read_urb_busy = true; | 795 | mos7840_port->read_urb_busy = true; |
798 | retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); | 796 | retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); |
799 | 797 | ||
@@ -2058,7 +2056,6 @@ static void mos7840_change_port_settings(struct tty_struct *tty, | |||
2058 | mos7840_set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); | 2056 | mos7840_set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data); |
2059 | 2057 | ||
2060 | if (mos7840_port->read_urb_busy == false) { | 2058 | if (mos7840_port->read_urb_busy == false) { |
2061 | mos7840_port->read_urb->dev = serial->dev; | ||
2062 | mos7840_port->read_urb_busy = true; | 2059 | mos7840_port->read_urb_busy = true; |
2063 | status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); | 2060 | status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); |
2064 | if (status) { | 2061 | if (status) { |
@@ -2130,7 +2127,6 @@ static void mos7840_set_termios(struct tty_struct *tty, | |||
2130 | } | 2127 | } |
2131 | 2128 | ||
2132 | if (mos7840_port->read_urb_busy == false) { | 2129 | if (mos7840_port->read_urb_busy == false) { |
2133 | mos7840_port->read_urb->dev = serial->dev; | ||
2134 | mos7840_port->read_urb_busy = true; | 2130 | mos7840_port->read_urb_busy = true; |
2135 | status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); | 2131 | status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC); |
2136 | if (status) { | 2132 | if (status) { |
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 1594bde8f9b3..f3824641099a 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c | |||
@@ -154,6 +154,7 @@ static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
154 | port->read_urb->transfer_buffer, | 154 | port->read_urb->transfer_buffer, |
155 | port->read_urb->transfer_buffer_length, | 155 | port->read_urb->transfer_buffer_length, |
156 | omninet_read_bulk_callback, port); | 156 | omninet_read_bulk_callback, port); |
157 | |||
157 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); | 158 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); |
158 | if (result) | 159 | if (result) |
159 | dev_err(&port->dev, | 160 | dev_err(&port->dev, |
@@ -262,7 +263,6 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port, | |||
262 | /* send the data out the bulk port, always 64 bytes */ | 263 | /* send the data out the bulk port, always 64 bytes */ |
263 | wport->write_urb->transfer_buffer_length = 64; | 264 | wport->write_urb->transfer_buffer_length = 64; |
264 | 265 | ||
265 | wport->write_urb->dev = serial->dev; | ||
266 | result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); | 266 | result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); |
267 | if (result) { | 267 | if (result) { |
268 | set_bit(0, &wport->write_urbs_free); | 268 | set_bit(0, &wport->write_urbs_free); |
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index c248a9147439..691f57a9d712 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c | |||
@@ -384,7 +384,6 @@ static void opticon_unthrottle(struct tty_struct *tty) | |||
384 | priv->actually_throttled = false; | 384 | priv->actually_throttled = false; |
385 | spin_unlock_irqrestore(&priv->lock, flags); | 385 | spin_unlock_irqrestore(&priv->lock, flags); |
386 | 386 | ||
387 | priv->bulk_read_urb->dev = port->serial->dev; | ||
388 | if (was_throttled) { | 387 | if (was_throttled) { |
389 | result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC); | 388 | result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC); |
390 | if (result) | 389 | if (result) |
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index 4c29e6c2bda7..2bc1c1a44a75 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
@@ -264,7 +264,6 @@ static void setup_line(struct work_struct *work) | |||
264 | spin_unlock_irqrestore(&priv->lock, flags); | 264 | spin_unlock_irqrestore(&priv->lock, flags); |
265 | 265 | ||
266 | dbg("%s(): submitting interrupt urb", __func__); | 266 | dbg("%s(): submitting interrupt urb", __func__); |
267 | port->interrupt_in_urb->dev = port->serial->dev; | ||
268 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 267 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
269 | if (result != 0) { | 268 | if (result != 0) { |
270 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" | 269 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" |
@@ -321,7 +320,6 @@ static void send_data(struct work_struct *work) | |||
321 | priv->flags.write_urb_in_use = 0; | 320 | priv->flags.write_urb_in_use = 0; |
322 | 321 | ||
323 | dbg("%s(): submitting interrupt urb", __func__); | 322 | dbg("%s(): submitting interrupt urb", __func__); |
324 | port->interrupt_in_urb->dev = port->serial->dev; | ||
325 | result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); | 323 | result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO); |
326 | if (result != 0) { | 324 | if (result != 0) { |
327 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" | 325 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" |
@@ -334,7 +332,6 @@ static void send_data(struct work_struct *work) | |||
334 | port->write_urb->transfer_buffer, | 332 | port->write_urb->transfer_buffer, |
335 | count, &port->lock); | 333 | count, &port->lock); |
336 | port->write_urb->transfer_buffer_length = count; | 334 | port->write_urb->transfer_buffer_length = count; |
337 | port->write_urb->dev = port->serial->dev; | ||
338 | result = usb_submit_urb(port->write_urb, GFP_NOIO); | 335 | result = usb_submit_urb(port->write_urb, GFP_NOIO); |
339 | if (result != 0) { | 336 | if (result != 0) { |
340 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" | 337 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" |
@@ -583,7 +580,6 @@ static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
583 | kfree(buf); | 580 | kfree(buf); |
584 | 581 | ||
585 | dbg("%s(): submitting interrupt urb", __func__); | 582 | dbg("%s(): submitting interrupt urb", __func__); |
586 | port->interrupt_in_urb->dev = serial->dev; | ||
587 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); | 583 | result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); |
588 | if (result != 0) { | 584 | if (result != 0) { |
589 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" | 585 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" |
@@ -837,7 +833,6 @@ static void oti6858_read_int_callback(struct urb *urb) | |||
837 | if (can_recv) { | 833 | if (can_recv) { |
838 | int result; | 834 | int result; |
839 | 835 | ||
840 | port->read_urb->dev = port->serial->dev; | ||
841 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); | 836 | result = usb_submit_urb(port->read_urb, GFP_ATOMIC); |
842 | if (result != 0) { | 837 | if (result != 0) { |
843 | priv->flags.read_urb_in_use = 0; | 838 | priv->flags.read_urb_in_use = 0; |
@@ -866,7 +861,6 @@ static void oti6858_read_int_callback(struct urb *urb) | |||
866 | int result; | 861 | int result; |
867 | 862 | ||
868 | /* dbg("%s(): submitting interrupt urb", __func__); */ | 863 | /* dbg("%s(): submitting interrupt urb", __func__); */ |
869 | urb->dev = port->serial->dev; | ||
870 | result = usb_submit_urb(urb, GFP_ATOMIC); | 864 | result = usb_submit_urb(urb, GFP_ATOMIC); |
871 | if (result != 0) { | 865 | if (result != 0) { |
872 | dev_err(&urb->dev->dev, | 866 | dev_err(&urb->dev->dev, |
@@ -918,7 +912,6 @@ static void oti6858_read_bulk_callback(struct urb *urb) | |||
918 | tty_kref_put(tty); | 912 | tty_kref_put(tty); |
919 | 913 | ||
920 | /* schedule the interrupt urb */ | 914 | /* schedule the interrupt urb */ |
921 | port->interrupt_in_urb->dev = port->serial->dev; | ||
922 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); | 915 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); |
923 | if (result != 0 && result != -EPERM) { | 916 | if (result != 0 && result != -EPERM) { |
924 | dev_err(&port->dev, "%s(): usb_submit_urb() failed," | 917 | dev_err(&port->dev, "%s(): usb_submit_urb() failed," |
@@ -955,7 +948,6 @@ static void oti6858_write_bulk_callback(struct urb *urb) | |||
955 | dbg("%s(): overflow in write", __func__); | 948 | dbg("%s(): overflow in write", __func__); |
956 | 949 | ||
957 | port->write_urb->transfer_buffer_length = 1; | 950 | port->write_urb->transfer_buffer_length = 1; |
958 | port->write_urb->dev = port->serial->dev; | ||
959 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 951 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
960 | if (result) { | 952 | if (result) { |
961 | dev_err(&port->dev, "%s(): usb_submit_urb() failed," | 953 | dev_err(&port->dev, "%s(): usb_submit_urb() failed," |
@@ -968,7 +960,6 @@ static void oti6858_write_bulk_callback(struct urb *urb) | |||
968 | priv->flags.write_urb_in_use = 0; | 960 | priv->flags.write_urb_in_use = 0; |
969 | 961 | ||
970 | /* schedule the interrupt urb if we are still open */ | 962 | /* schedule the interrupt urb if we are still open */ |
971 | port->interrupt_in_urb->dev = port->serial->dev; | ||
972 | dbg("%s(): submitting interrupt urb", __func__); | 963 | dbg("%s(): submitting interrupt urb", __func__); |
973 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); | 964 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); |
974 | if (result != 0) { | 965 | if (result != 0) { |
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index b18179bda0d8..f2485429172f 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c | |||
@@ -681,7 +681,6 @@ static void sierra_instat_callback(struct urb *urb) | |||
681 | /* Resubmit urb so we continue receiving IRQ data */ | 681 | /* Resubmit urb so we continue receiving IRQ data */ |
682 | if (status != -ESHUTDOWN && status != -ENOENT) { | 682 | if (status != -ESHUTDOWN && status != -ENOENT) { |
683 | usb_mark_last_busy(serial->dev); | 683 | usb_mark_last_busy(serial->dev); |
684 | urb->dev = serial->dev; | ||
685 | err = usb_submit_urb(urb, GFP_ATOMIC); | 684 | err = usb_submit_urb(urb, GFP_ATOMIC); |
686 | if (err && err != -EPERM) | 685 | if (err && err != -EPERM) |
687 | dev_err(&port->dev, "%s: resubmit intr urb " | 686 | dev_err(&port->dev, "%s: resubmit intr urb " |
diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 7096f799b071..c70cc012d03f 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c | |||
@@ -182,7 +182,6 @@ static void symbol_unthrottle(struct tty_struct *tty) | |||
182 | priv->actually_throttled = false; | 182 | priv->actually_throttled = false; |
183 | spin_unlock_irq(&priv->lock); | 183 | spin_unlock_irq(&priv->lock); |
184 | 184 | ||
185 | priv->int_urb->dev = port->serial->dev; | ||
186 | if (was_throttled) { | 185 | if (was_throttled) { |
187 | result = usb_submit_urb(priv->int_urb, GFP_KERNEL); | 186 | result = usb_submit_urb(priv->int_urb, GFP_KERNEL); |
188 | if (result) | 187 | if (result) |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index ea8445689c85..6d16717ef4f7 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -537,7 +537,6 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
537 | } | 537 | } |
538 | urb->complete = ti_interrupt_callback; | 538 | urb->complete = ti_interrupt_callback; |
539 | urb->context = tdev; | 539 | urb->context = tdev; |
540 | urb->dev = dev; | ||
541 | status = usb_submit_urb(urb, GFP_KERNEL); | 540 | status = usb_submit_urb(urb, GFP_KERNEL); |
542 | if (status) { | 541 | if (status) { |
543 | dev_err(&port->dev, | 542 | dev_err(&port->dev, |
@@ -621,7 +620,6 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
621 | tport->tp_read_urb_state = TI_READ_URB_RUNNING; | 620 | tport->tp_read_urb_state = TI_READ_URB_RUNNING; |
622 | urb->complete = ti_bulk_in_callback; | 621 | urb->complete = ti_bulk_in_callback; |
623 | urb->context = tport; | 622 | urb->context = tport; |
624 | urb->dev = dev; | ||
625 | status = usb_submit_urb(urb, GFP_KERNEL); | 623 | status = usb_submit_urb(urb, GFP_KERNEL); |
626 | if (status) { | 624 | if (status) { |
627 | dev_err(&port->dev, "%s - submit read urb failed, %d\n", | 625 | dev_err(&port->dev, "%s - submit read urb failed, %d\n", |
@@ -1236,12 +1234,11 @@ static void ti_bulk_in_callback(struct urb *urb) | |||
1236 | exit: | 1234 | exit: |
1237 | /* continue to read unless stopping */ | 1235 | /* continue to read unless stopping */ |
1238 | spin_lock(&tport->tp_lock); | 1236 | spin_lock(&tport->tp_lock); |
1239 | if (tport->tp_read_urb_state == TI_READ_URB_RUNNING) { | 1237 | if (tport->tp_read_urb_state == TI_READ_URB_RUNNING) |
1240 | urb->dev = port->serial->dev; | ||
1241 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 1238 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
1242 | } else if (tport->tp_read_urb_state == TI_READ_URB_STOPPING) { | 1239 | else if (tport->tp_read_urb_state == TI_READ_URB_STOPPING) |
1243 | tport->tp_read_urb_state = TI_READ_URB_STOPPED; | 1240 | tport->tp_read_urb_state = TI_READ_URB_STOPPED; |
1244 | } | 1241 | |
1245 | spin_unlock(&tport->tp_lock); | 1242 | spin_unlock(&tport->tp_lock); |
1246 | if (retval) | 1243 | if (retval) |
1247 | dev_err(dev, "%s - resubmit read urb failed, %d\n", | 1244 | dev_err(dev, "%s - resubmit read urb failed, %d\n", |
@@ -1576,7 +1573,6 @@ static int ti_restart_read(struct ti_port *tport, struct tty_struct *tty) | |||
1576 | spin_unlock_irqrestore(&tport->tp_lock, flags); | 1573 | spin_unlock_irqrestore(&tport->tp_lock, flags); |
1577 | urb->complete = ti_bulk_in_callback; | 1574 | urb->complete = ti_bulk_in_callback; |
1578 | urb->context = tport; | 1575 | urb->context = tport; |
1579 | urb->dev = tport->tp_port->serial->dev; | ||
1580 | status = usb_submit_urb(urb, GFP_KERNEL); | 1576 | status = usb_submit_urb(urb, GFP_KERNEL); |
1581 | } else { | 1577 | } else { |
1582 | tport->tp_read_urb_state = TI_READ_URB_RUNNING; | 1578 | tport->tp_read_urb_state = TI_READ_URB_RUNNING; |
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index 7eb360b1f8b9..11af903cb09f 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -702,7 +702,6 @@ static void whiteheat_close(struct usb_serial_port *port) | |||
702 | static int whiteheat_write(struct tty_struct *tty, | 702 | static int whiteheat_write(struct tty_struct *tty, |
703 | struct usb_serial_port *port, const unsigned char *buf, int count) | 703 | struct usb_serial_port *port, const unsigned char *buf, int count) |
704 | { | 704 | { |
705 | struct usb_serial *serial = port->serial; | ||
706 | struct whiteheat_private *info = usb_get_serial_port_data(port); | 705 | struct whiteheat_private *info = usb_get_serial_port_data(port); |
707 | struct whiteheat_urb_wrap *wrap; | 706 | struct whiteheat_urb_wrap *wrap; |
708 | struct urb *urb; | 707 | struct urb *urb; |
@@ -738,7 +737,6 @@ static int whiteheat_write(struct tty_struct *tty, | |||
738 | usb_serial_debug_data(debug, &port->dev, | 737 | usb_serial_debug_data(debug, &port->dev, |
739 | __func__, bytes, urb->transfer_buffer); | 738 | __func__, bytes, urb->transfer_buffer); |
740 | 739 | ||
741 | urb->dev = serial->dev; | ||
742 | urb->transfer_buffer_length = bytes; | 740 | urb->transfer_buffer_length = bytes; |
743 | result = usb_submit_urb(urb, GFP_ATOMIC); | 741 | result = usb_submit_urb(urb, GFP_ATOMIC); |
744 | if (result) { | 742 | if (result) { |
@@ -984,7 +982,6 @@ static void command_port_read_callback(struct urb *urb) | |||
984 | dbg("%s - bad reply from firmware", __func__); | 982 | dbg("%s - bad reply from firmware", __func__); |
985 | 983 | ||
986 | /* Continue trying to always read */ | 984 | /* Continue trying to always read */ |
987 | command_port->read_urb->dev = command_port->serial->dev; | ||
988 | result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC); | 985 | result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC); |
989 | if (result) | 986 | if (result) |
990 | dbg("%s - failed resubmitting read urb, error %d", | 987 | dbg("%s - failed resubmitting read urb, error %d", |
@@ -1090,7 +1087,6 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, | |||
1090 | transfer_buffer[0] = command; | 1087 | transfer_buffer[0] = command; |
1091 | memcpy(&transfer_buffer[1], data, datasize); | 1088 | memcpy(&transfer_buffer[1], data, datasize); |
1092 | command_port->write_urb->transfer_buffer_length = datasize + 1; | 1089 | command_port->write_urb->transfer_buffer_length = datasize + 1; |
1093 | command_port->write_urb->dev = port->serial->dev; | ||
1094 | retval = usb_submit_urb(command_port->write_urb, GFP_NOIO); | 1090 | retval = usb_submit_urb(command_port->write_urb, GFP_NOIO); |
1095 | if (retval) { | 1091 | if (retval) { |
1096 | dbg("%s - submit urb failed", __func__); | 1092 | dbg("%s - submit urb failed", __func__); |
@@ -1311,7 +1307,6 @@ static int start_command_port(struct usb_serial *serial) | |||
1311 | /* Work around HCD bugs */ | 1307 | /* Work around HCD bugs */ |
1312 | usb_clear_halt(serial->dev, command_port->read_urb->pipe); | 1308 | usb_clear_halt(serial->dev, command_port->read_urb->pipe); |
1313 | 1309 | ||
1314 | command_port->read_urb->dev = serial->dev; | ||
1315 | retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL); | 1310 | retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL); |
1316 | if (retval) { | 1311 | if (retval) { |
1317 | dev_err(&serial->dev->dev, | 1312 | dev_err(&serial->dev->dev, |
@@ -1359,7 +1354,6 @@ static int start_port_read(struct usb_serial_port *port) | |||
1359 | list_del(tmp); | 1354 | list_del(tmp); |
1360 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); | 1355 | wrap = list_entry(tmp, struct whiteheat_urb_wrap, list); |
1361 | urb = wrap->urb; | 1356 | urb = wrap->urb; |
1362 | urb->dev = port->serial->dev; | ||
1363 | spin_unlock_irqrestore(&info->lock, flags); | 1357 | spin_unlock_irqrestore(&info->lock, flags); |
1364 | retval = usb_submit_urb(urb, GFP_KERNEL); | 1358 | retval = usb_submit_urb(urb, GFP_KERNEL); |
1365 | if (retval) { | 1359 | if (retval) { |
@@ -1439,7 +1433,6 @@ static void rx_data_softint(struct work_struct *work) | |||
1439 | sent += tty_insert_flip_string(tty, | 1433 | sent += tty_insert_flip_string(tty, |
1440 | urb->transfer_buffer, urb->actual_length); | 1434 | urb->transfer_buffer, urb->actual_length); |
1441 | 1435 | ||
1442 | urb->dev = port->serial->dev; | ||
1443 | result = usb_submit_urb(urb, GFP_ATOMIC); | 1436 | result = usb_submit_urb(urb, GFP_ATOMIC); |
1444 | if (result) { | 1437 | if (result) { |
1445 | dev_err(&port->dev, | 1438 | dev_err(&port->dev, |