]> git.baikalelectronics.ru Git - kernel.git/commit
usb-serial: straighten out serial_open
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 1 Sep 2009 15:39:59 +0000 (11:39 -0400)
committerLive-CD User <linux@linux.site>
Sat, 19 Sep 2009 20:13:42 +0000 (13:13 -0700)
commite9566feedbd552b81eafbfe309123ab2d01c45e3
treedc49860c46437290db4b994c581bce42a2b8cc09
parent1b8c46819eee54861c63955689144ce9c0c7c881
usb-serial: straighten out serial_open

This patch (as1291) removes a bunch of code from serial_open(), things
that were rendered unnecessary by earlier patches.  A missing spinlock
is added to protect port->port.count, which needs to be incremented
even if the open fails but not if the tty has gotten a hangup.  The
test for whether the hardware has been initialized, based on the use
count, is replaced by a more transparent test of the
ASYNCB_INITIALIZED bit in the port flags.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/usb-serial.c