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 17:55:12 -0500 |
commit | 1f87158e44e79e62c8250f278c225ce4ab695f4b (patch) | |
tree | eff328f63a75993a3e1ffbba9c9f0ba1fecf0edb /drivers/usb/serial/keyspan.c | |
parent | a108bfcb372d8c4452701039308fb95747911c59 (diff) |
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) | |||
464 | 464 | ||
465 | /* Resubmit urb so we continue receiving */ | 465 | /* Resubmit urb so we continue receiving */ |
466 | urb->dev = port->serial->dev; | 466 | urb->dev = port->serial->dev; |
467 | if (port->port.count) { | 467 | err = usb_submit_urb(urb, GFP_ATOMIC); |
468 | err = usb_submit_urb(urb, GFP_ATOMIC); | 468 | if (err != 0) |
469 | if (err != 0) | 469 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
470 | dbg("%s - resubmit read urb failed. (%d)", | ||
471 | __func__, err); | ||
472 | } | ||
473 | return; | ||
474 | } | 470 | } |
475 | 471 | ||
476 | /* Outdat handling is common for all devices */ | 472 | /* Outdat handling is common for all devices */ |
@@ -483,8 +479,7 @@ static void usa2x_outdat_callback(struct urb *urb) | |||
483 | p_priv = usb_get_serial_port_data(port); | 479 | p_priv = usb_get_serial_port_data(port); |
484 | dbg("%s - urb %d", __func__, urb == p_priv->out_urbs[1]); | 480 | dbg("%s - urb %d", __func__, urb == p_priv->out_urbs[1]); |
485 | 481 | ||
486 | if (port->port.count) | 482 | usb_serial_port_softint(port); |
487 | usb_serial_port_softint(port); | ||
488 | } | 483 | } |
489 | 484 | ||
490 | static void usa26_inack_callback(struct urb *urb) | 485 | static void usa26_inack_callback(struct urb *urb) |
@@ -615,12 +610,10 @@ static void usa28_indat_callback(struct urb *urb) | |||
615 | 610 | ||
616 | /* Resubmit urb so we continue receiving */ | 611 | /* Resubmit urb so we continue receiving */ |
617 | urb->dev = port->serial->dev; | 612 | urb->dev = port->serial->dev; |
618 | if (port->port.count) { | 613 | err = usb_submit_urb(urb, GFP_ATOMIC); |
619 | err = usb_submit_urb(urb, GFP_ATOMIC); | 614 | if (err != 0) |
620 | if (err != 0) | 615 | dbg("%s - resubmit read urb failed. (%d)", |
621 | dbg("%s - resubmit read urb failed. (%d)", | 616 | __func__, err); |
622 | __func__, err); | ||
623 | } | ||
624 | p_priv->in_flip ^= 1; | 617 | p_priv->in_flip ^= 1; |
625 | 618 | ||
626 | urb = p_priv->in_urbs[p_priv->in_flip]; | 619 | urb = p_priv->in_urbs[p_priv->in_flip]; |
@@ -856,12 +849,9 @@ static void usa49_indat_callback(struct urb *urb) | |||
856 | 849 | ||
857 | /* Resubmit urb so we continue receiving */ | 850 | /* Resubmit urb so we continue receiving */ |
858 | urb->dev = port->serial->dev; | 851 | urb->dev = port->serial->dev; |
859 | if (port->port.count) { | 852 | err = usb_submit_urb(urb, GFP_ATOMIC); |
860 | err = usb_submit_urb(urb, GFP_ATOMIC); | 853 | if (err != 0) |
861 | if (err != 0) | 854 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
862 | dbg("%s - resubmit read urb failed. (%d)", | ||
863 | __func__, err); | ||
864 | } | ||
865 | } | 855 | } |
866 | 856 | ||
867 | static void usa49wg_indat_callback(struct urb *urb) | 857 | static void usa49wg_indat_callback(struct urb *urb) |
@@ -904,11 +894,7 @@ static void usa49wg_indat_callback(struct urb *urb) | |||
904 | /* no error on any byte */ | 894 | /* no error on any byte */ |
905 | i++; | 895 | i++; |
906 | for (x = 1; x < len ; ++x) | 896 | for (x = 1; x < len ; ++x) |
907 | if (port->port.count) | 897 | tty_insert_flip_char(tty, data[i++], 0); |
908 | tty_insert_flip_char(tty, | ||
909 | data[i++], 0); | ||
910 | else | ||
911 | i++; | ||
912 | } else { | 898 | } else { |
913 | /* | 899 | /* |
914 | * some bytes had errors, every byte has status | 900 | * some bytes had errors, every byte has status |
@@ -922,14 +908,12 @@ static void usa49wg_indat_callback(struct urb *urb) | |||
922 | if (stat & RXERROR_PARITY) | 908 | if (stat & RXERROR_PARITY) |
923 | flag |= TTY_PARITY; | 909 | flag |= TTY_PARITY; |
924 | /* XXX should handle break (0x10) */ | 910 | /* XXX should handle break (0x10) */ |
925 | if (port->port.count) | 911 | tty_insert_flip_char(tty, |
926 | tty_insert_flip_char(tty, | ||
927 | data[i+1], flag); | 912 | data[i+1], flag); |
928 | i += 2; | 913 | i += 2; |
929 | } | 914 | } |
930 | } | 915 | } |
931 | if (port->port.count) | 916 | tty_flip_buffer_push(tty); |
932 | tty_flip_buffer_push(tty); | ||
933 | tty_kref_put(tty); | 917 | tty_kref_put(tty); |
934 | } | 918 | } |
935 | } | 919 | } |
@@ -1013,13 +997,9 @@ static void usa90_indat_callback(struct urb *urb) | |||
1013 | 997 | ||
1014 | /* Resubmit urb so we continue receiving */ | 998 | /* Resubmit urb so we continue receiving */ |
1015 | urb->dev = port->serial->dev; | 999 | urb->dev = port->serial->dev; |
1016 | if (port->port.count) { | 1000 | err = usb_submit_urb(urb, GFP_ATOMIC); |
1017 | err = usb_submit_urb(urb, GFP_ATOMIC); | 1001 | if (err != 0) |
1018 | if (err != 0) | 1002 | dbg("%s - resubmit read urb failed. (%d)", __func__, err); |
1019 | dbg("%s - resubmit read urb failed. (%d)", | ||
1020 | __func__, err); | ||
1021 | } | ||
1022 | return; | ||
1023 | } | 1003 | } |
1024 | 1004 | ||
1025 | 1005 | ||
@@ -2418,8 +2398,7 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial, | |||
2418 | msg.portEnabled = 0; | 2398 | msg.portEnabled = 0; |
2419 | /* Sending intermediate configs */ | 2399 | /* Sending intermediate configs */ |
2420 | else { | 2400 | else { |
2421 | if (port->port.count) | 2401 | msg.portEnabled = 1; |
2422 | msg.portEnabled = 1; | ||
2423 | msg.txBreak = (p_priv->break_on); | 2402 | msg.txBreak = (p_priv->break_on); |
2424 | } | 2403 | } |
2425 | 2404 | ||