diff options
author | Jan Dumon <j.dumon@option.com> | 2010-01-05 04:51:28 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-07 00:43:45 -0800 |
commit | f4763e96c08ea0790750603999e5b3158c3b50d4 (patch) | |
tree | ec0b326a66ae8eea1b179c8b3b698b5c8d5020d0 /drivers | |
parent | d9ced80d1084758772d350ac66b1ad0eeefc7f95 (diff) | |
download | linux-stable-f4763e96c08ea0790750603999e5b3158c3b50d4.tar.gz linux-stable-f4763e96c08ea0790750603999e5b3158c3b50d4.tar.bz2 linux-stable-f4763e96c08ea0790750603999e5b3158c3b50d4.zip |
hso: don't change the state of a closed port
Don't change the state of a port if it's not open. This fixes an issue where a
port sometimes has to be opened twice before data can be received.
Signed-off-by: Jan Dumon <j.dumon@option.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/usb/hso.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index aba90e77e077..fb1c5ac55c01 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -1915,18 +1915,18 @@ static void intr_callback(struct urb *urb) if (serial != NULL) { D1("Pending read interrupt on port %d\n", i); spin_lock(&serial->serial_lock); - if (serial->rx_state == RX_IDLE) { + if (serial->rx_state == RX_IDLE && + serial->open_count > 0) { /* Setup and send a ctrl req read on * port i */ - if (!serial->rx_urb_filled[0]) { + if (!serial->rx_urb_filled[0]) { serial->rx_state = RX_SENT; hso_mux_serial_read(serial); } else serial->rx_state = RX_PENDING; - } else { - D1("Already pending a read on " - "port %d\n", i); + D1("Already a read pending on " + "port %d or port not open\n", i); } spin_unlock(&serial->serial_lock); } |