aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-03-28 16:10:49 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-09 18:36:20 -0400
commit891a3b1fddb24b4b53426685bd0390bb74c9b5b3 (patch)
tree4012c0f2365d14475f68223a2bee149f0341b99b /include/linux/usb
parent3a450850e2bb0f92cacb12da90fe98eccd105468 (diff)
USB: fix bug in serial driver unregistration
This patch (as1536) fixes a bug in the USB serial core. Unloading and reloading a serial driver while a serial device is plugged in causes errors because of the code in usb_serial_disconnect() that tries to make sure the port_remove method is called. With the new order of driver registration introduced in the 3.4 kernel, this is definitely not the right thing to do (if indeed it ever was). The patch removes that whole section code, along with the mechanism for keeping track of each port's registration state, which is no longer needed. The driver core can handle all that stuff for us. Note: This has been tested only with one or two USB serial drivers. In theory, other drivers might still run into trouble. But if they do, it will be the fault of the drivers, not of this patch -- that is, the drivers will need to be fixed. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-and-tested-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/serial.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index fbb666b1b67..47428388823 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -28,13 +28,6 @@
28/* parity check flag */ 28/* parity check flag */
29#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) 29#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
30 30
31enum port_dev_state {
32 PORT_UNREGISTERED,
33 PORT_REGISTERING,
34 PORT_REGISTERED,
35 PORT_UNREGISTERING,
36};
37
38/* USB serial flags */ 31/* USB serial flags */
39#define USB_SERIAL_WRITE_BUSY 0 32#define USB_SERIAL_WRITE_BUSY 0
40 33
@@ -124,7 +117,6 @@ struct usb_serial_port {
124 char throttle_req; 117 char throttle_req;
125 unsigned long sysrq; /* sysrq timeout */ 118 unsigned long sysrq; /* sysrq timeout */
126 struct device dev; 119 struct device dev;
127 enum port_dev_state dev_state;
128}; 120};
129#define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) 121#define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev)
130 122