USB: serial: clean up usb-serial bus device removal
authorJohan Hovold <jhovold@gmail.com>
Thu, 21 Mar 2013 11:36:50 +0000 (12:36 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Mar 2013 20:48:27 +0000 (13:48 -0700)
commit5cb27dde2e8b7bcbdce6de270c73c021a65caff8
tree31822932c11b0b4d3d034a92c5fc4320d367af0b
parent6a5c821cad1459ec2b5fd5778f46d13c4255a7bf
USB: serial: clean up usb-serial bus device removal

Make sure to unregister the tty-device before calling subdriver
port_remove.

This way remove will reverse probe, and specifically any port data
released in port_remove will be available throughout tty unregister.

Note that the order currently does not matter as the tty-layer can make
callbacks also after the device has been unregistered. This is
handled in usb-serial core using the disconnected flag, which is
already set when usb-serial bus device remove is called.

Cc: Peter Hurley <peter@hurleysoftware.com>
Reported-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/bus.c