aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/usb-serial.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 8511352251f3..7639022cdf84 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -138,6 +138,11 @@ static void destroy_serial(struct kref *kref)
138 138
139 dbg("%s - %s", __FUNCTION__, serial->type->description); 139 dbg("%s - %s", __FUNCTION__, serial->type->description);
140 140
141 serial->type->shutdown(serial);
142
143 /* return the minor range that this device had */
144 return_serial(serial);
145
141 for (i = 0; i < serial->num_ports; ++i) 146 for (i = 0; i < serial->num_ports; ++i)
142 serial->port[i]->open_count = 0; 147 serial->port[i]->open_count = 0;
143 148
@@ -148,12 +153,6 @@ static void destroy_serial(struct kref *kref)
148 serial->port[i] = NULL; 153 serial->port[i] = NULL;
149 } 154 }
150 155
151 if (serial->type->shutdown)
152 serial->type->shutdown(serial);
153
154 /* return the minor range that this device had */
155 return_serial(serial);
156
157 /* If this is a "fake" port, we have to clean it up here, as it will 156 /* If this is a "fake" port, we have to clean it up here, as it will
158 * not get cleaned up in port_release() as it was never registered with 157 * not get cleaned up in port_release() as it was never registered with
159 * the driver core */ 158 * the driver core */