aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/usb-serial.c
diff options
context:
space:
mode:
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)
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 */