Al Borcher's original post: http://www.mail-archive.com/[email protected]/msg27475.html
Signed-off-by: Edwin Olson ([EMAIL PROTECTED])
diff -uprbB -X dontdiff linux-2.6.9-orig/drivers/usb/serial/usb-serial.c linux-2.6.9-discon/drivers/usb/serial/usb-serial.c
--- linux-2.6.9-orig/drivers/usb/serial/usb-serial.c 2004-10-18 17:55:36.000000000 -0400
+++ linux-2.6.9-discon/drivers/usb/serial/usb-serial.c 2004-11-30 21:23:16.338244909 -0500
@@ -1189,13 +1189,21 @@ probe_error:
void usb_serial_disconnect(struct usb_interface *interface)
{
+ int i;
struct usb_serial *serial = usb_get_intfdata (interface);
struct device *dev = &interface->dev;
+ struct usb_serial_port *port;
dbg ("%s", __FUNCTION__);
usb_set_intfdata (interface, NULL);
if (serial) {
+ for (i = 0; i < serial->num_ports; ++i) {
+ port = serial->port[i];
+ if (port && port->tty) {
+ tty_hangup(port->tty);
+ }
+ }
/* let the last holder of this object
* cause it to be cleaned up */
kref_put(&serial->kref, destroy_serial);
