usb-serial: acquire references when a new tty is installed
commit11f4140f0e28e7ee9d1c3d824f8210759d2e8514
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 1 Sep 2009 15:39:13 +0000 (1 11:39 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Oct 2009 16:32:39 +0000 (5 09:32 -0700)
tree34febdc58d8a799198df209797877242db1a2ca1
parente40aac84871676390759cd7d38658da3b7d7fb57
usb-serial: acquire references when a new tty is installed

commit cc56cd0157753c04a987888a2f793803df661a40 upstream.

This patch (as1287) makes serial_install() be reponsible for acquiring
references to the usb_serial structure and the driver module when a
tty is first used.  This is more sensible than having serial_open() do
it, because a tty can be opened many times whereas it is installed
only once, when it is created.  (Not to mention that these actions are
reversed when the tty is released, not when it is closed.)  Finally,
it is at install time that the TTY core takes its own reference to the
usb_serial module, so it is only fitting that we should act the same
way in regard to the lower-level serial driver.

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