diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-06-02 11:54:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:47 -0400 |
commit | c706ebdfc8955b850e477255a8c0f93f9f14712d (patch) | |
tree | 1f880601cdd2663ee4206783092d5fa9d90c8922 /include/linux/usb | |
parent | c6994e6f067cf0fc4c6cca3d164018b1150916f8 (diff) |
USB: usb-serial: call port_probe and port_remove at the right times
This patch (as1253) prevents the usb-serial core from calling a
driver's port_probe and port_remove methods more than once per port.
It also removes some unnecessary try_module_get() calls and adds a
missing port_remove method call in a failure path.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r-- | include/linux/usb/serial.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index e29ebcf3287b..ed4aa0fa7ed8 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -27,6 +27,13 @@ | |||
27 | /* parity check flag */ | 27 | /* parity check flag */ |
28 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | 28 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
29 | 29 | ||
30 | enum port_dev_state { | ||
31 | PORT_UNREGISTERED, | ||
32 | PORT_REGISTERING, | ||
33 | PORT_REGISTERED, | ||
34 | PORT_UNREGISTERING, | ||
35 | }; | ||
36 | |||
30 | /** | 37 | /** |
31 | * usb_serial_port: structure for the specific ports of a device. | 38 | * usb_serial_port: structure for the specific ports of a device. |
32 | * @serial: pointer back to the struct usb_serial owner of this port. | 39 | * @serial: pointer back to the struct usb_serial owner of this port. |
@@ -102,6 +109,7 @@ struct usb_serial_port { | |||
102 | char console; | 109 | char console; |
103 | unsigned long sysrq; /* sysrq timeout */ | 110 | unsigned long sysrq; /* sysrq timeout */ |
104 | struct device dev; | 111 | struct device dev; |
112 | enum port_dev_state dev_state; | ||
105 | }; | 113 | }; |
106 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) | 114 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) |
107 | 115 | ||