diff options
author | Jim Radford <radford@blackbean.org> | 2007-02-28 11:14:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-03-09 22:52:24 -0500 |
commit | d9a7ecacac5f8274d2afce09aadcf37bdb42b93a (patch) | |
tree | ece61cf44c0b8edc961080a2c8c4bc5cf585a7c4 /drivers/usb | |
parent | 4eaf60e0114946d82ef523e8c0718831cbdd3414 (diff) |
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')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 11 |
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) | |||
135 | 135 | ||
136 | dbg("%s - %s", __FUNCTION__, serial->type->description); | 136 | dbg("%s - %s", __FUNCTION__, serial->type->description); |
137 | 137 | ||
138 | serial->type->shutdown(serial); | ||
139 | |||
140 | /* return the minor range that this device had */ | ||
141 | return_serial(serial); | ||
142 | |||
143 | for (i = 0; i < serial->num_ports; ++i) | 138 | for (i = 0; i < serial->num_ports; ++i) |
144 | serial->port[i]->open_count = 0; | 139 | serial->port[i]->open_count = 0; |
145 | 140 | ||
@@ -150,6 +145,12 @@ static void destroy_serial(struct kref *kref) | |||
150 | serial->port[i] = NULL; | 145 | serial->port[i] = NULL; |
151 | } | 146 | } |
152 | 147 | ||
148 | if (serial->type->shutdown) | ||
149 | serial->type->shutdown(serial); | ||
150 | |||
151 | /* return the minor range that this device had */ | ||
152 | return_serial(serial); | ||
153 | |||
153 | /* If this is a "fake" port, we have to clean it up here, as it will | 154 | /* If this is a "fake" port, we have to clean it up here, as it will |
154 | * not get cleaned up in port_release() as it was never registered with | 155 | * not get cleaned up in port_release() as it was never registered with |
155 | * the driver core */ | 156 | * the driver core */ |