USB: serial: remove unnecessary reinitialisations of urb->dev
authorJohan Hovold <jhovold@gmail.com>
Sun, 6 Nov 2011 18:06:28 +0000 (19:06 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Nov 2011 18:33:16 +0000 (10:33 -0800)
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>
20 files changed:
drivers/usb/serial/ch341.c
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/io_edgeport.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/keyspan.c
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/mct_u232.c
drivers/usb/serial/mos7720.c
drivers/usb/serial/mos7840.c
drivers/usb/serial/omninet.c
drivers/usb/serial/opticon.c
drivers/usb/serial/oti6858.c
drivers/usb/serial/sierra.c
drivers/usb/serial/symbolserial.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/whiteheat.c

index 6ae1c0688b5e14cb03cb9905ea793ac6caa4f84b..8607f1522ef32db4036b0f0f644e422d04ab3cea 100644 (file)
@@ -335,7 +335,6 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
                goto out;
 
        dbg("%s - submitting interrupt urb", __func__);
-       port->interrupt_in_urb->dev = serial->dev;
        r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
        if (r) {
                dev_err(&port->dev, "%s - failed submitting interrupt urb,"
index 5a41252807cbdcd904c979edf9c596cffbdd457f..2b220e811bf16623094aca0e2f62e589b522477d 100644 (file)
@@ -138,7 +138,6 @@ static int cyberjack_startup(struct usb_serial *serial)
 
        for (i = 0; i < serial->num_ports; ++i) {
                int result;
-               serial->port[i]->interrupt_in_urb->dev = serial->dev;
                result = usb_submit_urb(serial->port[i]->interrupt_in_urb,
                                        GFP_KERNEL);
                if (result)
@@ -347,7 +346,6 @@ static void cyberjack_read_int_callback(struct urb *urb)
                spin_unlock(&priv->lock);
 
                if (!old_rdtodo) {
-                       port->read_urb->dev = port->serial->dev;
                        result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
                        if (result)
                                dev_err(&port->dev, "%s - failed resubmitting "
@@ -358,7 +356,6 @@ static void cyberjack_read_int_callback(struct urb *urb)
        }
 
 resubmit:
-       port->interrupt_in_urb->dev = port->serial->dev;
        result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
        if (result)
                dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
@@ -411,7 +408,6 @@ static void cyberjack_read_bulk_callback(struct urb *urb)
 
        /* Continue to read if we have still urbs to do. */
        if (todo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/) {
-               port->read_urb->dev = port->serial->dev;
                result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
                if (result)
                        dev_err(&port->dev, "%s - failed resubmitting read "
index b20440e58d8fa008bc1284f4842de38a547b7ccb..07680d6b792b59ebff8143f851837659e3ae51dc 100644 (file)
@@ -1136,8 +1136,6 @@ static void cypress_unthrottle(struct tty_struct *tty)
                return;
 
        if (actually_throttled) {
-               port->interrupt_in_urb->dev = port->serial->dev;
-
                result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
                if (result) {
                        dev_err(&port->dev, "%s - failed submitting read urb, "
@@ -1326,7 +1324,6 @@ static void cypress_write_int_callback(struct urb *urb)
                dbg("%s - nonzero write bulk status received: %d",
                        __func__, status);
                port->interrupt_out_urb->transfer_buffer_length = 1;
-               port->interrupt_out_urb->dev = port->serial->dev;
                result = usb_submit_urb(port->interrupt_out_urb, GFP_ATOMIC);
                if (!result)
                        return;
index 3786e9544ae006893ca927039a01e20504adfa27..6d26a77d0f2aedf0302696b48e5c399f44203749 100644 (file)
@@ -438,7 +438,6 @@ static int digi_write_oob_command(struct usb_serial_port *port,
                        len &= ~3;
                memcpy(oob_port->write_urb->transfer_buffer, buf, len);
                oob_port->write_urb->transfer_buffer_length = len;
-               oob_port->write_urb->dev = port->serial->dev;
                ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC);
                if (ret == 0) {
                        oob_priv->dp_write_urb_in_use = 1;
@@ -516,7 +515,6 @@ static int digi_write_inb_command(struct usb_serial_port *port,
                        memcpy(data, buf, len);
                        port->write_urb->transfer_buffer_length = len;
                }
-               port->write_urb->dev = port->serial->dev;
 
                ret = usb_submit_urb(port->write_urb, GFP_ATOMIC);
                if (ret == 0) {
@@ -587,7 +585,6 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
        data[7] = 0;
 
        oob_port->write_urb->transfer_buffer_length = 8;
-       oob_port->write_urb->dev = port->serial->dev;
 
        ret = usb_submit_urb(oob_port->write_urb, GFP_ATOMIC);
        if (ret == 0) {
@@ -683,10 +680,8 @@ static void digi_rx_unthrottle(struct tty_struct *tty)
        spin_lock_irqsave(&priv->dp_port_lock, flags);
 
        /* restart read chain */
-       if (priv->dp_throttle_restart) {
-               port->read_urb->dev = port->serial->dev;
+       if (priv->dp_throttle_restart)
                ret = usb_submit_urb(port->read_urb, GFP_ATOMIC);
-       }
 
        /* turn throttle off */
        priv->dp_throttled = 0;
@@ -979,7 +974,6 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
        }
 
        port->write_urb->transfer_buffer_length = data_len+2;
-       port->write_urb->dev = port->serial->dev;
 
        *data++ = DIGI_CMD_SEND_DATA;
        *data++ = data_len;
@@ -1055,7 +1049,6 @@ static void digi_write_bulk_callback(struct urb *urb)
                        = (unsigned char)priv->dp_out_buf_len;
                port->write_urb->transfer_buffer_length =
                                                priv->dp_out_buf_len + 2;
-               port->write_urb->dev = serial->dev;
                memcpy(port->write_urb->transfer_buffer + 2, priv->dp_out_buf,
                        priv->dp_out_buf_len);
                ret = usb_submit_urb(port->write_urb, GFP_ATOMIC);
@@ -1257,7 +1250,6 @@ static int digi_startup_device(struct usb_serial *serial)
        /* set USB_DISABLE_SPD flag for write bulk urbs */
        for (i = 0; i < serial->type->num_ports + 1; i++) {
                port = serial->port[i];
-               port->write_urb->dev = port->serial->dev;
                ret = usb_submit_urb(port->read_urb, GFP_KERNEL);
                if (ret != 0) {
                        dev_err(&port->dev,
@@ -1400,7 +1392,6 @@ static void digi_read_bulk_callback(struct urb *urb)
        }
 
        /* continue read */
-       urb->dev = port->serial->dev;
        ret = usb_submit_urb(urb, GFP_ATOMIC);
        if (ret != 0 && ret != -EPERM) {
                dev_err(&port->dev,
index 1a49ca9c8ea5b85992e5dad5e2a859561ab85337..d39da13d3dba42b15c7ecb05e5b663fcd5cf1234 100644 (file)
@@ -901,7 +901,6 @@ static int garmin_init_session(struct usb_serial_port *port)
                usb_kill_urb(port->interrupt_in_urb);
 
                dbg("%s - adding interrupt input", __func__);
-               port->interrupt_in_urb->dev = serial->dev;
                status = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
                if (status)
                        dev_err(&serial->dev->dev,
@@ -1353,7 +1352,6 @@ static void garmin_read_int_callback(struct urb *urb)
 
        garmin_read_process(garmin_data_p, data, urb->actual_length, 0);
 
-       port->interrupt_in_urb->dev = port->serial->dev;
        retval = usb_submit_urb(urb, GFP_ATOMIC);
        if (retval)
                dev_err(&urb->dev->dev,
index 2ee807523f5379741e795a09f9d03837fbf2f989..abd2ee2b2f9942c2cdf35f1e29f0a5e83ed08b26 100644 (file)
@@ -610,7 +610,6 @@ static void edge_interrupt_callback(struct urb *urb)
 
                                        /* we have pending bytes on the
                                           bulk in pipe, send a request */
-                                       edge_serial->read_urb->dev = edge_serial->serial->dev;
                                        result = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC);
                                        if (result) {
                                                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)
        /* check to see if there's any more data for us to read */
        if (edge_serial->rxBytesAvail > 0) {
                dbg("%s - posting a read", __func__);
-               edge_serial->read_urb->dev = edge_serial->serial->dev;
                retval = usb_submit_urb(edge_serial->read_urb, GFP_ATOMIC);
                if (retval) {
                        dev_err(&urb->dev->dev,
@@ -1330,7 +1328,6 @@ static void send_more_port_data(struct edgeport_serial *edge_serial,
        edge_port->txCredits -= count;
        edge_port->icount.tx += count;
 
-       urb->dev = edge_serial->serial->dev;
        status = usb_submit_urb(urb, GFP_ATOMIC);
        if (status) {
                /* something went wrong */
index e42ddfc02aaa145f1a1bebb0378e1d2c1d38693e..29fba8ccf8e2431cad40ee52d25190c3b82eea0b 100644 (file)
@@ -1770,12 +1770,11 @@ static void edge_bulk_in_callback(struct urb *urb)
 exit:
        /* continue read unless stopped */
        spin_lock(&edge_port->ep_lock);
-       if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING) {
-               urb->dev = edge_port->port->serial->dev;
+       if (edge_port->ep_read_urb_state == EDGE_READ_URB_RUNNING)
                retval = usb_submit_urb(urb, GFP_ATOMIC);
-       } else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING) {
+       else if (edge_port->ep_read_urb_state == EDGE_READ_URB_STOPPING)
                edge_port->ep_read_urb_state = EDGE_READ_URB_STOPPED;
-       }
+
        spin_unlock(&edge_port->ep_lock);
        if (retval)
                dev_err(&urb->dev->dev,
@@ -1954,7 +1953,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
                }
                urb->complete = edge_interrupt_callback;
                urb->context = edge_serial;
-               urb->dev = dev;
                status = usb_submit_urb(urb, GFP_KERNEL);
                if (status) {
                        dev_err(&port->dev,
@@ -1982,7 +1980,6 @@ static int edge_open(struct tty_struct *tty, struct usb_serial_port *port)
        edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING;
        urb->complete = edge_bulk_in_callback;
        urb->context = edge_port;
-       urb->dev = dev;
        status = usb_submit_urb(urb, GFP_KERNEL);
        if (status) {
                dev_err(&port->dev,
@@ -2262,7 +2259,6 @@ static int restart_read(struct edgeport_port *edge_port)
                urb = edge_port->port->read_urb;
                urb->complete = edge_bulk_in_callback;
                urb->context = edge_port;
-               urb->dev = edge_port->port->serial->dev;
                status = usb_submit_urb(urb, GFP_ATOMIC);
        }
        edge_port->ep_read_urb_state = EDGE_READ_URB_RUNNING;
index 65356620c253aa9f5105f7ad0ee6f764146fd84b..bc8dc203e818342b270104717d0133e38ef6cf8e 100644 (file)
@@ -330,7 +330,6 @@ static int keyspan_write(struct tty_struct *tty,
                /* send the data out the bulk port */
                this_urb->transfer_buffer_length = todo + dataOffset;
 
-               this_urb->dev = port->serial->dev;
                err = usb_submit_urb(this_urb, GFP_ATOMIC);
                if (err != 0)
                        dbg("usb_submit_urb(write bulk) failed (%d)", err);
@@ -396,7 +395,6 @@ static void usa26_indat_callback(struct urb *urb)
        tty_kref_put(tty);
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = port->serial->dev;
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -492,7 +490,6 @@ static void usa26_instat_callback(struct urb *urb)
        }
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = serial->dev;
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -542,7 +539,6 @@ static void usa28_indat_callback(struct urb *urb)
                tty_kref_put(tty);
 
                /* Resubmit urb so we continue receiving */
-               urb->dev = port->serial->dev;
                err = usb_submit_urb(urb, GFP_ATOMIC);
                if (err != 0)
                        dbg("%s - resubmit read urb failed. (%d)",
@@ -627,7 +623,6 @@ static void usa28_instat_callback(struct urb *urb)
        }
 
                /* Resubmit urb so we continue receiving */
-       urb->dev = serial->dev;
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -722,8 +717,6 @@ static void usa49_instat_callback(struct urb *urb)
        }
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = serial->dev;
-
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -781,7 +774,6 @@ static void usa49_indat_callback(struct urb *urb)
        tty_kref_put(tty);
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = port->serial->dev;
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -852,8 +844,6 @@ static void usa49wg_indat_callback(struct urb *urb)
        }
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = serial->dev;
-
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -929,7 +919,6 @@ static void usa90_indat_callback(struct urb *urb)
        }
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = port->serial->dev;
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -980,7 +969,6 @@ static void usa90_instat_callback(struct urb *urb)
        }
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = serial->dev;
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - resubmit read urb failed. (%d)", __func__, err);
@@ -1056,7 +1044,6 @@ static void       usa67_instat_callback(struct urb *urb)
        }
 
        /* Resubmit urb so we continue receiving */
-       urb->dev = serial->dev;
        err = usb_submit_urb(urb, GFP_ATOMIC);
        if (err != 0)
                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)
                urb = p_priv->in_urbs[i];
                if (urb == NULL)
                        continue;
-               urb->dev = serial->dev;
 
                /* make sure endpoint data toggle is synchronized
                   with the device */
@@ -1172,7 +1158,6 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port)
                urb = p_priv->out_urbs[i];
                if (urb == NULL)
                        continue;
-               urb->dev = serial->dev;
                /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe),
                                                usb_pipeout(urb->pipe), 0); */
        }
@@ -1889,7 +1874,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial,
        /* send the data out the device on control endpoint */
        this_urb->transfer_buffer_length = sizeof(msg);
 
-       this_urb->dev = serial->dev;
        err = usb_submit_urb(this_urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - usb_submit_urb(setup) failed (%d)", __func__, err);
@@ -2017,7 +2001,6 @@ static int keyspan_usa28_send_setup(struct usb_serial *serial,
        /* send the data out the device on control endpoint */
        this_urb->transfer_buffer_length = sizeof(msg);
 
-       this_urb->dev = serial->dev;
        err = usb_submit_urb(this_urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - usb_submit_urb(setup) failed", __func__);
@@ -2204,8 +2187,6 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial,
 
                /* send the data out the device on control endpoint */
                this_urb->transfer_buffer_length = sizeof(msg);
-
-               this_urb->dev = serial->dev;
        }
        err = usb_submit_urb(this_urb, GFP_ATOMIC);
        if (err != 0)
@@ -2348,7 +2329,6 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial,
        /* send the data out the device on control endpoint */
        this_urb->transfer_buffer_length = sizeof(msg);
 
-       this_urb->dev = serial->dev;
        err = usb_submit_urb(this_urb, GFP_ATOMIC);
        if (err != 0)
                dbg("%s - usb_submit_urb(setup) failed (%d)", __func__, err);
@@ -2494,7 +2474,6 @@ static int keyspan_usa67_send_setup(struct usb_serial *serial,
 
        /* send the data out the device on control endpoint */
        this_urb->transfer_buffer_length = sizeof(msg);
-       this_urb->dev = serial->dev;
 
        err = usb_submit_urb(this_urb, GFP_ATOMIC);
        if (err != 0)
@@ -2583,14 +2562,12 @@ static int keyspan_startup(struct usb_serial *serial)
        keyspan_setup_urbs(serial);
 
        if (s_priv->instat_urb != NULL) {
-               s_priv->instat_urb->dev = serial->dev;
                err = usb_submit_urb(s_priv->instat_urb, GFP_KERNEL);
                if (err != 0)
                        dbg("%s - submit instat urb failed %d", __func__,
                                err);
        }
        if (s_priv->indat_urb != NULL) {
-               s_priv->indat_urb->dev = serial->dev;
                err = usb_submit_urb(s_priv->indat_urb, GFP_KERNEL);
                if (err != 0)
                        dbg("%s - submit indat urb failed %d", __func__,
index 9428cc0cfb12bac9619335abd9567676780bc621..a40615674a6815e20ed44a7bbba1953943c176ea 100644 (file)
@@ -237,7 +237,6 @@ static void keyspan_pda_rx_unthrottle(struct tty_struct *tty)
        struct usb_serial_port *port = tty->driver_data;
        /* just restart the receive interrupt URB */
        dbg("keyspan_pda_rx_unthrottle port %d", port->number);
-       port->interrupt_in_urb->dev = port->serial->dev;
        if (usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL))
                dbg(" usb_submit_urb(read urb) failed");
 }
@@ -545,7 +544,6 @@ static int keyspan_pda_write(struct tty_struct *tty,
 
                priv->tx_room -= count;
 
-               port->write_urb->dev = port->serial->dev;
                rc = usb_submit_urb(port->write_urb, GFP_ATOMIC);
                if (rc) {
                        dbg(" usb_submit_urb(write bulk) failed");
@@ -664,7 +662,6 @@ static int keyspan_pda_open(struct tty_struct *tty,
        priv->tx_throttled = *room ? 0 : 1;
 
        /*Start reading from the device*/
-       port->interrupt_in_urb->dev = serial->dev;
        rc = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
        if (rc) {
                dbg("%s - usb_submit_urb(read int) failed", __func__);
index 2ecfc0101a4c01b4fc77dc41ee2a5bb14359975e..5d3beeeb5fd9b527359190b3e0076b6b85fb2d43 100644 (file)
@@ -219,9 +219,6 @@ static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port)
        dbg("%s - port %d", __func__, port->number);
        priv = usb_get_serial_port_data(port);
 
-       /* someone sets the dev to 0 if the close method has been called */
-       port->interrupt_in_urb->dev = port->serial->dev;
-
        /* allocate memory for transfer buffer */
        transfer_buffer = kzalloc(transfer_buffer_length, GFP_KERNEL);
        if (!transfer_buffer)
@@ -381,8 +378,6 @@ static void kobil_read_int_callback(struct urb *urb)
                tty_flip_buffer_push(tty);
        }
        tty_kref_put(tty);
-       /* someone sets the dev to 0 if the close method has been called */
-       port->interrupt_in_urb->dev = port->serial->dev;
 
        result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
        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,
                priv->filled = 0;
                priv->cur_pos = 0;
 
-               /* someone sets the dev to 0 if the close method
-                  has been called */
-               port->interrupt_in_urb->dev = port->serial->dev;
-
                /* start reading (except TWIN and KAAN SIM) */
                if (priv->device_type == KOBIL_ADAPTER_B_PRODUCT_ID ||
                        priv->device_type == KOBIL_ADAPTER_K_PRODUCT_ID) {
-                       /* someone sets the dev to 0 if the close method has
-                          been called */
-                       port->interrupt_in_urb->dev = port->serial->dev;
-
                        result = usb_submit_urb(port->interrupt_in_urb,
                                                                GFP_NOIO);
                        dbg("%s - port %d Send read URB returns: %i",
index 6804efeb945630414ede6cc9fbe5e89ead4c9e08..a975bb80303f9ddad9b6ef62394a1d2889fcbf5a 100644 (file)
@@ -482,7 +482,6 @@ static int  mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port)
        mct_u232_msr_to_state(&priv->control_state, priv->last_msr);
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       port->read_urb->dev = port->serial->dev;
        retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
        if (retval) {
                dev_err(&port->dev,
@@ -491,7 +490,6 @@ static int  mct_u232_open(struct tty_struct *tty, struct usb_serial_port *port)
                goto error;
        }
 
-       port->interrupt_in_urb->dev = port->serial->dev;
        retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
        if (retval) {
                usb_kill_urb(port->read_urb);
index 51b56b0c42283ab2b7ff7f4b4e6b071761b3fe37..19d112f51b97516b325d07c984a7e71f03e7d665 100644 (file)
@@ -940,8 +940,6 @@ static void mos7720_bulk_in_callback(struct urb *urb)
        tty_kref_put(tty);
 
        if (port->read_urb->status != -EINPROGRESS) {
-               port->read_urb->dev = port->serial->dev;
-
                retval = usb_submit_urb(port->read_urb, GFP_ATOMIC);
                if (retval)
                        dbg("usb_submit_urb(read bulk) failed, retval = %d",
@@ -1727,8 +1725,6 @@ static void change_port_settings(struct tty_struct *tty,
        write_mos_reg(serial, port_number, IER, 0x0c);
 
        if (port->read_urb->status != -EINPROGRESS) {
-               port->read_urb->dev = serial->dev;
-
                status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
                if (status)
                        dbg("usb_submit_urb(read bulk) failed, status = %d",
@@ -1779,7 +1775,6 @@ static void mos7720_set_termios(struct tty_struct *tty,
        change_port_settings(tty, mos7720_port, old_termios);
 
        if (port->read_urb->status != -EINPROGRESS) {
-               port->read_urb->dev = serial->dev;
                status = usb_submit_urb(port->read_urb, GFP_ATOMIC);
                if (status)
                        dbg("usb_submit_urb(read bulk) failed, status = %d",
index c72abd52498324e061bc2b3256aff77048bf70f1..55cfd6265b98b7d91afb6bc1d9c91ad7245256db 100644 (file)
@@ -792,8 +792,6 @@ static void mos7840_bulk_in_callback(struct urb *urb)
        }
 
 
-       mos7840_port->read_urb->dev = serial->dev;
-
        mos7840_port->read_urb_busy = true;
        retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
 
@@ -2058,7 +2056,6 @@ static void mos7840_change_port_settings(struct tty_struct *tty,
        mos7840_set_uart_reg(port, INTERRUPT_ENABLE_REGISTER, Data);
 
        if (mos7840_port->read_urb_busy == false) {
-               mos7840_port->read_urb->dev = serial->dev;
                mos7840_port->read_urb_busy = true;
                status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
                if (status) {
@@ -2130,7 +2127,6 @@ static void mos7840_set_termios(struct tty_struct *tty,
        }
 
        if (mos7840_port->read_urb_busy == false) {
-               mos7840_port->read_urb->dev = serial->dev;
                mos7840_port->read_urb_busy = true;
                status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
                if (status) {
index 1594bde8f9b3ef94f940eb2053154371839778fa..f3824641099ae5a1403105b159a9d2f900b07c43 100644 (file)
@@ -154,6 +154,7 @@ static int omninet_open(struct tty_struct *tty, struct usb_serial_port *port)
                        port->read_urb->transfer_buffer,
                        port->read_urb->transfer_buffer_length,
                        omninet_read_bulk_callback, port);
+
        result = usb_submit_urb(port->read_urb, GFP_KERNEL);
        if (result)
                dev_err(&port->dev,
@@ -262,7 +263,6 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
        /* send the data out the bulk port, always 64 bytes */
        wport->write_urb->transfer_buffer_length = 64;
 
-       wport->write_urb->dev = serial->dev;
        result = usb_submit_urb(wport->write_urb, GFP_ATOMIC);
        if (result) {
                set_bit(0, &wport->write_urbs_free);
index c248a9147439ad88264bc1047cf8d703fe656685..691f57a9d712a4b45e44137d9539595fdff83471 100644 (file)
@@ -384,7 +384,6 @@ static void opticon_unthrottle(struct tty_struct *tty)
        priv->actually_throttled = false;
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       priv->bulk_read_urb->dev = port->serial->dev;
        if (was_throttled) {
                result = usb_submit_urb(priv->bulk_read_urb, GFP_ATOMIC);
                if (result)
index 4c29e6c2bda7aaf9ca6529069301edbf207f209d..2bc1c1a44a752b91d5914a2e48c5ec1f2c9af7b0 100644 (file)
@@ -264,7 +264,6 @@ static void setup_line(struct work_struct *work)
        spin_unlock_irqrestore(&priv->lock, flags);
 
        dbg("%s(): submitting interrupt urb", __func__);
-       port->interrupt_in_urb->dev = port->serial->dev;
        result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
        if (result != 0) {
                dev_err(&port->dev, "%s(): usb_submit_urb() failed"
@@ -321,7 +320,6 @@ static void send_data(struct work_struct *work)
                priv->flags.write_urb_in_use = 0;
 
                dbg("%s(): submitting interrupt urb", __func__);
-               port->interrupt_in_urb->dev = port->serial->dev;
                result = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
                if (result != 0) {
                        dev_err(&port->dev, "%s(): usb_submit_urb() failed"
@@ -334,7 +332,6 @@ static void send_data(struct work_struct *work)
                                        port->write_urb->transfer_buffer,
                                        count, &port->lock);
        port->write_urb->transfer_buffer_length = count;
-       port->write_urb->dev = port->serial->dev;
        result = usb_submit_urb(port->write_urb, GFP_NOIO);
        if (result != 0) {
                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)
        kfree(buf);
 
        dbg("%s(): submitting interrupt urb", __func__);
-       port->interrupt_in_urb->dev = serial->dev;
        result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
        if (result != 0) {
                dev_err(&port->dev, "%s(): usb_submit_urb() failed"
@@ -837,7 +833,6 @@ static void oti6858_read_int_callback(struct urb *urb)
        if (can_recv) {
                int result;
 
-               port->read_urb->dev = port->serial->dev;
                result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
                if (result != 0) {
                        priv->flags.read_urb_in_use = 0;
@@ -866,7 +861,6 @@ static void oti6858_read_int_callback(struct urb *urb)
                int result;
 
 /*             dbg("%s(): submitting interrupt urb", __func__); */
-               urb->dev = port->serial->dev;
                result = usb_submit_urb(urb, GFP_ATOMIC);
                if (result != 0) {
                        dev_err(&urb->dev->dev,
@@ -918,7 +912,6 @@ static void oti6858_read_bulk_callback(struct urb *urb)
        tty_kref_put(tty);
 
        /* schedule the interrupt urb */
-       port->interrupt_in_urb->dev = port->serial->dev;
        result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
        if (result != 0 && result != -EPERM) {
                dev_err(&port->dev, "%s(): usb_submit_urb() failed,"
@@ -955,7 +948,6 @@ static void oti6858_write_bulk_callback(struct urb *urb)
                dbg("%s(): overflow in write", __func__);
 
                port->write_urb->transfer_buffer_length = 1;
-               port->write_urb->dev = port->serial->dev;
                result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
                if (result) {
                        dev_err(&port->dev, "%s(): usb_submit_urb() failed,"
@@ -968,7 +960,6 @@ static void oti6858_write_bulk_callback(struct urb *urb)
        priv->flags.write_urb_in_use = 0;
 
        /* schedule the interrupt urb if we are still open */
-       port->interrupt_in_urb->dev = port->serial->dev;
        dbg("%s(): submitting interrupt urb", __func__);
        result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
        if (result != 0) {
index b18179bda0d8a0f7cd46b436e282ad08096e90d4..f2485429172faada3be3932990669e5991628afd 100644 (file)
@@ -681,7 +681,6 @@ static void sierra_instat_callback(struct urb *urb)
        /* Resubmit urb so we continue receiving IRQ data */
        if (status != -ESHUTDOWN && status != -ENOENT) {
                usb_mark_last_busy(serial->dev);
-               urb->dev = serial->dev;
                err = usb_submit_urb(urb, GFP_ATOMIC);
                if (err && err != -EPERM)
                        dev_err(&port->dev, "%s: resubmit intr urb "
index 7096f799b071a1813888c714746dc1623b81acb2..c70cc012d03f2e7b82724bcc6a58423e78fb12b2 100644 (file)
@@ -182,7 +182,6 @@ static void symbol_unthrottle(struct tty_struct *tty)
        priv->actually_throttled = false;
        spin_unlock_irq(&priv->lock);
 
-       priv->int_urb->dev = port->serial->dev;
        if (was_throttled) {
                result = usb_submit_urb(priv->int_urb, GFP_KERNEL);
                if (result)
index ea8445689c8501f82795a9fe29c95b9fbcd73183..6d16717ef4f7f51be98c69521b2702e390409dd1 100644 (file)
@@ -537,7 +537,6 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
                }
                urb->complete = ti_interrupt_callback;
                urb->context = tdev;
-               urb->dev = dev;
                status = usb_submit_urb(urb, GFP_KERNEL);
                if (status) {
                        dev_err(&port->dev,
@@ -621,7 +620,6 @@ static int ti_open(struct tty_struct *tty, struct usb_serial_port *port)
        tport->tp_read_urb_state = TI_READ_URB_RUNNING;
        urb->complete = ti_bulk_in_callback;
        urb->context = tport;
-       urb->dev = dev;
        status = usb_submit_urb(urb, GFP_KERNEL);
        if (status) {
                dev_err(&port->dev, "%s - submit read urb failed, %d\n",
@@ -1236,12 +1234,11 @@ static void ti_bulk_in_callback(struct urb *urb)
 exit:
        /* continue to read unless stopping */
        spin_lock(&tport->tp_lock);
-       if (tport->tp_read_urb_state == TI_READ_URB_RUNNING) {
-               urb->dev = port->serial->dev;
+       if (tport->tp_read_urb_state == TI_READ_URB_RUNNING)
                retval = usb_submit_urb(urb, GFP_ATOMIC);
-       } else if (tport->tp_read_urb_state == TI_READ_URB_STOPPING) {
+       else if (tport->tp_read_urb_state == TI_READ_URB_STOPPING)
                tport->tp_read_urb_state = TI_READ_URB_STOPPED;
-       }
+
        spin_unlock(&tport->tp_lock);
        if (retval)
                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)
                spin_unlock_irqrestore(&tport->tp_lock, flags);
                urb->complete = ti_bulk_in_callback;
                urb->context = tport;
-               urb->dev = tport->tp_port->serial->dev;
                status = usb_submit_urb(urb, GFP_KERNEL);
        } else  {
                tport->tp_read_urb_state = TI_READ_URB_RUNNING;
index 7eb360b1f8b97f66ef6afb22835ce7dd19a209e8..11af903cb09f3da5d0b7a8ebf3fbc0f273faa3fe 100644 (file)
@@ -702,7 +702,6 @@ static void whiteheat_close(struct usb_serial_port *port)
 static int whiteheat_write(struct tty_struct *tty,
        struct usb_serial_port *port, const unsigned char *buf, int count)
 {
-       struct usb_serial *serial = port->serial;
        struct whiteheat_private *info = usb_get_serial_port_data(port);
        struct whiteheat_urb_wrap *wrap;
        struct urb *urb;
@@ -738,7 +737,6 @@ static int whiteheat_write(struct tty_struct *tty,
                usb_serial_debug_data(debug, &port->dev,
                                __func__, bytes, urb->transfer_buffer);
 
-               urb->dev = serial->dev;
                urb->transfer_buffer_length = bytes;
                result = usb_submit_urb(urb, GFP_ATOMIC);
                if (result) {
@@ -984,7 +982,6 @@ static void command_port_read_callback(struct urb *urb)
                dbg("%s - bad reply from firmware", __func__);
 
        /* Continue trying to always read */
-       command_port->read_urb->dev = command_port->serial->dev;
        result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC);
        if (result)
                dbg("%s - failed resubmitting read urb, error %d",
@@ -1090,7 +1087,6 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
        transfer_buffer[0] = command;
        memcpy(&transfer_buffer[1], data, datasize);
        command_port->write_urb->transfer_buffer_length = datasize + 1;
-       command_port->write_urb->dev = port->serial->dev;
        retval = usb_submit_urb(command_port->write_urb, GFP_NOIO);
        if (retval) {
                dbg("%s - submit urb failed", __func__);
@@ -1311,7 +1307,6 @@ static int start_command_port(struct usb_serial *serial)
                /* Work around HCD bugs */
                usb_clear_halt(serial->dev, command_port->read_urb->pipe);
 
-               command_port->read_urb->dev = serial->dev;
                retval = usb_submit_urb(command_port->read_urb, GFP_KERNEL);
                if (retval) {
                        dev_err(&serial->dev->dev,
@@ -1359,7 +1354,6 @@ static int start_port_read(struct usb_serial_port *port)
                list_del(tmp);
                wrap = list_entry(tmp, struct whiteheat_urb_wrap, list);
                urb = wrap->urb;
-               urb->dev = port->serial->dev;
                spin_unlock_irqrestore(&info->lock, flags);
                retval = usb_submit_urb(urb, GFP_KERNEL);
                if (retval) {
@@ -1439,7 +1433,6 @@ static void rx_data_softint(struct work_struct *work)
                        sent += tty_insert_flip_string(tty,
                                urb->transfer_buffer, urb->actual_length);
 
-               urb->dev = port->serial->dev;
                result = usb_submit_urb(urb, GFP_ATOMIC);
                if (result) {
                        dev_err(&port->dev,