diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-02-17 10:05:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 14:55:12 -0800 |
commit | 1f87158e44e79e62c8250f278c225ce4ab695f4b (patch) | |
tree | eff328f63a75993a3e1ffbba9c9f0ba1fecf0edb /drivers/usb/serial/keyspan.c | |
parent | a108bfcb372d8c4452701039308fb95747911c59 (diff) | |
download | blackbird-op-linux-1f87158e44e79e62c8250f278c225ce4ab695f4b.tar.gz blackbird-op-linux-1f87158e44e79e62c8250f278c225ce4ab695f4b.zip |
USB: remove references to port->port.count from the serial drivers
This patch (as1344) removes references to port->port.count from the
USB serial drivers. Now that serial ports are properly reference
counted, port.count checking is unnecessary and incorrect. Drivers
should assume that the port is in use from the time the open method
runs until the close method is called.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/keyspan.c')
-rw-r--r-- | drivers/usb/serial/keyspan.c | 57 |
1 files changed, 18 insertions, 39 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index f8c4b07033ff..297163c3c610 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c @@ -464,13 +464,9 @@ static void usa26_indat_callback(struct urb *urb) /* Resubmit urb so we continue receiving */ urb->dev = port->serial->dev; - if (port->port.count) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err != 0) - dbg("%s - resubmit read urb failed. (%d)", - __func__, err); - } - return; + err = usb_submit_urb(urb, GFP_ATOMIC); + if (err != 0) + dbg("%s - resubmit read urb failed. (%d)", __func__, err); } /* Outdat handling is common for all devices */ @@ -483,8 +479,7 @@ static void usa2x_outdat_callback(struct urb *urb) p_priv = usb_get_serial_port_data(port); dbg("%s - urb %d", __func__, urb == p_priv->out_urbs[1]); - if (port->port.count) - usb_serial_port_softint(port); + usb_serial_port_softint(port); } static void usa26_inack_callback(struct urb *urb) @@ -615,12 +610,10 @@ static void usa28_indat_callback(struct urb *urb) /* Resubmit urb so we continue receiving */ urb->dev = port->serial->dev; - if (port->port.count) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err != 0) - dbg("%s - resubmit read urb failed. (%d)", - __func__, err); - } + err = usb_submit_urb(urb, GFP_ATOMIC); + if (err != 0) + dbg("%s - resubmit read urb failed. (%d)", + __func__, err); p_priv->in_flip ^= 1; urb = p_priv->in_urbs[p_priv->in_flip]; @@ -856,12 +849,9 @@ static void usa49_indat_callback(struct urb *urb) /* Resubmit urb so we continue receiving */ urb->dev = port->serial->dev; - if (port->port.count) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err != 0) - dbg("%s - resubmit read urb failed. (%d)", - __func__, err); - } + err = usb_submit_urb(urb, GFP_ATOMIC); + if (err != 0) + dbg("%s - resubmit read urb failed. (%d)", __func__, err); } static void usa49wg_indat_callback(struct urb *urb) @@ -904,11 +894,7 @@ static void usa49wg_indat_callback(struct urb *urb) /* no error on any byte */ i++; for (x = 1; x < len ; ++x) - if (port->port.count) - tty_insert_flip_char(tty, - data[i++], 0); - else - i++; + tty_insert_flip_char(tty, data[i++], 0); } else { /* * some bytes had errors, every byte has status @@ -922,14 +908,12 @@ static void usa49wg_indat_callback(struct urb *urb) if (stat & RXERROR_PARITY) flag |= TTY_PARITY; /* XXX should handle break (0x10) */ - if (port->port.count) - tty_insert_flip_char(tty, + tty_insert_flip_char(tty, data[i+1], flag); i += 2; } } - if (port->port.count) - tty_flip_buffer_push(tty); + tty_flip_buffer_push(tty); tty_kref_put(tty); } } @@ -1013,13 +997,9 @@ static void usa90_indat_callback(struct urb *urb) /* Resubmit urb so we continue receiving */ urb->dev = port->serial->dev; - if (port->port.count) { - err = usb_submit_urb(urb, GFP_ATOMIC); - if (err != 0) - dbg("%s - resubmit read urb failed. (%d)", - __func__, err); - } - return; + err = usb_submit_urb(urb, GFP_ATOMIC); + if (err != 0) + dbg("%s - resubmit read urb failed. (%d)", __func__, err); } @@ -2418,8 +2398,7 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial, msg.portEnabled = 0; /* Sending intermediate configs */ else { - if (port->port.count) - msg.portEnabled = 1; + msg.portEnabled = 1; msg.txBreak = (p_priv->break_on); } |