]> git.baikalelectronics.ru Git - kernel.git/commit
usb-serial: acquire references when a new tty is installed
authorAlan Stern <stern@rowland.harvard.edu>
Tue, 1 Sep 2009 15:39:13 +0000 (11:39 -0400)
committerLive-CD User <linux@linux.site>
Sat, 19 Sep 2009 20:13:40 +0000 (13:13 -0700)
commita54247b37dfeffc644e4083d24c231c326d48c4b
tree78397afa3711722fd859181a1228a14613e3bc8b
parentb716b1a07f8331ff6d55f6af2f11711a832fbbc3
usb-serial: acquire references when a new tty is installed

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