]> git.karo-electronics.de Git - karo-tx-linux.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)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:32:42 +0000 (09:32 -0700)
commite637e77245046fbb1d812543ced77e288614c66b
treef7c5c8ba5f0ab62d1cf67d631f4be4ec8d7ce790
parent8eefb51971e841d2c0af529ddab02babbf8ca8d5
usb-serial: straighten out serial_open

commit 320348c8d5c9b591282633ddb8959b42f7fc7a1c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/usb-serial.c