summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
authorJim Radford <radford@blackbean.org>2007-02-28 08:14:13 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2007-03-09 19:52:24 -0800
commitd9a7ecacac5f8274d2afce09aadcf37bdb42b93a (patch)
treeece61cf44c0b8edc961080a2c8c4bc5cf585a7c4 /drivers/usb/serial/usb-serial.c
parent4eaf60e0114946d82ef523e8c0718831cbdd3414 (diff)
downloadblackbird-op-linux-d9a7ecacac5f8274d2afce09aadcf37bdb42b93a.tar.gz
blackbird-op-linux-d9a7ecacac5f8274d2afce09aadcf37bdb42b93a.zip
usb-serial: fix shutdown / device_unregister order
Ensure that the ->port_remove() callbacks get called before the ->shutdown() callback which makeing the order symmetric with ->attach() being called before ->port_probe(). Signed-off-by: Jim Radford <radford@blackbean.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r--drivers/usb/serial/usb-serial.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 6bf22a28adb8..7f93abdac994 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -135,11 +135,6 @@ 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;
@@ -150,6 +145,12 @@ 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 */
OpenPOWER on IntegriCloud