diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-01-14 10:52:54 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-18 18:45:16 -0500 |
commit | 77de2518e854501c1542199449354fab4b2377ac (patch) | |
tree | 51b16609c50c9bb4c94af775e03a89c2271772c6 /drivers/usb/serial | |
parent | cbf50a4125f5242dd70b1f2342dbba2d94c6d94e (diff) |
USB: io_ti: move write-fifo flushing to close
Move write-fifo flushing from chase_port to close where it belongs.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/io_ti.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 58184f3de686..596f8c9474b4 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -521,8 +521,7 @@ exit_is_tx_active: | |||
521 | return bytes_left; | 521 | return bytes_left; |
522 | } | 522 | } |
523 | 523 | ||
524 | static void chase_port(struct edgeport_port *port, unsigned long timeout, | 524 | static void chase_port(struct edgeport_port *port, unsigned long timeout) |
525 | int flush) | ||
526 | { | 525 | { |
527 | int baud_rate; | 526 | int baud_rate; |
528 | struct tty_struct *tty = tty_port_tty_get(&port->port->port); | 527 | struct tty_struct *tty = tty_port_tty_get(&port->port->port); |
@@ -550,8 +549,6 @@ static void chase_port(struct edgeport_port *port, unsigned long timeout, | |||
550 | } | 549 | } |
551 | set_current_state(TASK_RUNNING); | 550 | set_current_state(TASK_RUNNING); |
552 | remove_wait_queue(&tty->write_wait, &wait); | 551 | remove_wait_queue(&tty->write_wait, &wait); |
553 | if (flush) | ||
554 | kfifo_reset_out(&port->write_fifo); | ||
555 | spin_unlock_irqrestore(&port->ep_lock, flags); | 552 | spin_unlock_irqrestore(&port->ep_lock, flags); |
556 | tty_kref_put(tty); | 553 | tty_kref_put(tty); |
557 | 554 | ||
@@ -1956,6 +1953,7 @@ static void edge_close(struct usb_serial_port *port) | |||
1956 | struct edgeport_serial *edge_serial; | 1953 | struct edgeport_serial *edge_serial; |
1957 | struct edgeport_port *edge_port; | 1954 | struct edgeport_port *edge_port; |
1958 | struct usb_serial *serial = port->serial; | 1955 | struct usb_serial *serial = port->serial; |
1956 | unsigned long flags; | ||
1959 | int port_number; | 1957 | int port_number; |
1960 | 1958 | ||
1961 | edge_serial = usb_get_serial_data(port->serial); | 1959 | edge_serial = usb_get_serial_data(port->serial); |
@@ -1967,12 +1965,14 @@ static void edge_close(struct usb_serial_port *port) | |||
1967 | * this flag and dump add read data */ | 1965 | * this flag and dump add read data */ |
1968 | edge_port->close_pending = 1; | 1966 | edge_port->close_pending = 1; |
1969 | 1967 | ||
1970 | /* chase the port close and flush */ | 1968 | chase_port(edge_port, (HZ * closing_wait) / 100); |
1971 | chase_port(edge_port, (HZ * closing_wait) / 100, 1); | ||
1972 | 1969 | ||
1973 | usb_kill_urb(port->read_urb); | 1970 | usb_kill_urb(port->read_urb); |
1974 | usb_kill_urb(port->write_urb); | 1971 | usb_kill_urb(port->write_urb); |
1975 | edge_port->ep_write_urb_in_use = 0; | 1972 | edge_port->ep_write_urb_in_use = 0; |
1973 | spin_lock_irqsave(&edge_port->ep_lock, flags); | ||
1974 | kfifo_reset_out(&edge_port->write_fifo); | ||
1975 | spin_unlock_irqrestore(&edge_port->ep_lock, flags); | ||
1976 | 1976 | ||
1977 | /* assuming we can still talk to the device, | 1977 | /* assuming we can still talk to the device, |
1978 | * send a close port command to it */ | 1978 | * send a close port command to it */ |
@@ -2515,7 +2515,7 @@ static void edge_break(struct tty_struct *tty, int break_state) | |||
2515 | int bv = 0; /* Off */ | 2515 | int bv = 0; /* Off */ |
2516 | 2516 | ||
2517 | /* chase the port close */ | 2517 | /* chase the port close */ |
2518 | chase_port(edge_port, 0, 0); | 2518 | chase_port(edge_port, 0); |
2519 | 2519 | ||
2520 | if (break_state == -1) | 2520 | if (break_state == -1) |
2521 | bv = 1; /* On */ | 2521 | bv = 1; /* On */ |