TTY: serial, use tty_port_close_start helper
authorJiri Slaby <jslaby@suse.cz>
Wed, 9 Nov 2011 20:33:46 +0000 (21:33 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Nov 2011 23:58:59 +0000 (15:58 -0800)
commitd30ccf08e8e01060288587f52a78c3ca0fcfc1fc
treed44dc3004d660f47454f7baa4c302e65401ac167
parent4cb0fbfdc81f29a414583bd05a9e324f8f19984d
TTY: serial, use tty_port_close_start helper

After the previous patches, the code is almost identical. There are
few differences in the helper code:
1) flush_buffer when flow_stopped
   * when a user doesn't care about the data, delete it anyways
2) ASYNCB_INITIALIZED test before wait_until_sent_from
   * obviously, there is nothing to wait for if the port is dead
3) drain_delay wait
   * we don't set drain_delay

So we can use the helper now. It indeed removes a bunch of duplicated
code.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/serial/serial_core.c