USB: fix usb-serial regression
authorJim Radford <radford@blackbean.org>
Tue, 13 Mar 2007 15:30:50 +0000 (08:30 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 19 Mar 2007 20:22:18 +0000 (13:22 -0700)
This patch reverts d9a7ecacac5f8274d2afce09aadcf37bdb42b93a since it
breaks drivers that need to access the ->port[] array in shutdown
(most of them).

Signed-Off: Jim Radford <radford@blackbean.org>
Acked-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/usb-serial.c

index 8511352251f33ea3f551438913b9a778bf0158db..7639022cdf84af83a74bcf5550abf5e642e527d6 100644 (file)
@@ -138,6 +138,11 @@ static void destroy_serial(struct kref *kref)
 
        dbg("%s - %s", __FUNCTION__, serial->type->description);
 
+       serial->type->shutdown(serial);
+
+       /* return the minor range that this device had */
+       return_serial(serial);
+
        for (i = 0; i < serial->num_ports; ++i)
                serial->port[i]->open_count = 0;
 
@@ -148,12 +153,6 @@ static void destroy_serial(struct kref *kref)
                        serial->port[i] = NULL;
                }
 
-       if (serial->type->shutdown)
-               serial->type->shutdown(serial);
-
-       /* return the minor range that this device had */
-       return_serial(serial);
-
        /* If this is a "fake" port, we have to clean it up here, as it will
         * not get cleaned up in port_release() as it was never registered with
         * the driver core */