diff options
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/bus.c | 5 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 23 |
2 files changed, 2 insertions, 26 deletions
diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index 7f547dc3a590..ed8adb052ca7 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c | |||
@@ -60,8 +60,6 @@ static int usb_serial_device_probe(struct device *dev) | |||
60 | retval = -ENODEV; | 60 | retval = -ENODEV; |
61 | goto exit; | 61 | goto exit; |
62 | } | 62 | } |
63 | if (port->dev_state != PORT_REGISTERING) | ||
64 | goto exit; | ||
65 | 63 | ||
66 | driver = port->serial->type; | 64 | driver = port->serial->type; |
67 | if (driver->port_probe) { | 65 | if (driver->port_probe) { |
@@ -98,9 +96,6 @@ static int usb_serial_device_remove(struct device *dev) | |||
98 | if (!port) | 96 | if (!port) |
99 | return -ENODEV; | 97 | return -ENODEV; |
100 | 98 | ||
101 | if (port->dev_state != PORT_UNREGISTERING) | ||
102 | return retval; | ||
103 | |||
104 | device_remove_file(&port->dev, &dev_attr_port_number); | 99 | device_remove_file(&port->dev, &dev_attr_port_number); |
105 | 100 | ||
106 | driver = port->serial->type; | 101 | driver = port->serial->type; |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 69230f01056a..5413bd500781 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -1070,17 +1070,12 @@ int usb_serial_probe(struct usb_interface *interface, | |||
1070 | port = serial->port[i]; | 1070 | port = serial->port[i]; |
1071 | dev_set_name(&port->dev, "ttyUSB%d", port->number); | 1071 | dev_set_name(&port->dev, "ttyUSB%d", port->number); |
1072 | dbg ("%s - registering %s", __func__, dev_name(&port->dev)); | 1072 | dbg ("%s - registering %s", __func__, dev_name(&port->dev)); |
1073 | port->dev_state = PORT_REGISTERING; | ||
1074 | device_enable_async_suspend(&port->dev); | 1073 | device_enable_async_suspend(&port->dev); |
1075 | 1074 | ||
1076 | retval = device_add(&port->dev); | 1075 | retval = device_add(&port->dev); |
1077 | if (retval) { | 1076 | if (retval) |
1078 | dev_err(&port->dev, "Error registering port device, " | 1077 | dev_err(&port->dev, "Error registering port device, " |
1079 | "continuing\n"); | 1078 | "continuing\n"); |
1080 | port->dev_state = PORT_UNREGISTERED; | ||
1081 | } else { | ||
1082 | port->dev_state = PORT_REGISTERED; | ||
1083 | } | ||
1084 | } | 1079 | } |
1085 | 1080 | ||
1086 | usb_serial_console_init(debug, minor); | 1081 | usb_serial_console_init(debug, minor); |
@@ -1124,22 +1119,8 @@ void usb_serial_disconnect(struct usb_interface *interface) | |||
1124 | } | 1119 | } |
1125 | kill_traffic(port); | 1120 | kill_traffic(port); |
1126 | cancel_work_sync(&port->work); | 1121 | cancel_work_sync(&port->work); |
1127 | if (port->dev_state == PORT_REGISTERED) { | 1122 | if (device_is_registered(&port->dev)) |
1128 | |||
1129 | /* Make sure the port is bound so that the | ||
1130 | * driver's port_remove method is called. | ||
1131 | */ | ||
1132 | if (!port->dev.driver) { | ||
1133 | int rc; | ||
1134 | |||
1135 | port->dev.driver = | ||
1136 | &serial->type->driver; | ||
1137 | rc = device_bind_driver(&port->dev); | ||
1138 | } | ||
1139 | port->dev_state = PORT_UNREGISTERING; | ||
1140 | device_del(&port->dev); | 1123 | device_del(&port->dev); |
1141 | port->dev_state = PORT_UNREGISTERED; | ||
1142 | } | ||
1143 | } | 1124 | } |
1144 | } | 1125 | } |
1145 | serial->type->disconnect(serial); | 1126 | serial->type->disconnect(serial); |