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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c6994e6f06
commit
c706ebdfc8
@@ -27,6 +27,13 @@
|
||||
/* parity check flag */
|
||||
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
|
||||
|
||||
enum port_dev_state {
|
||||
PORT_UNREGISTERED,
|
||||
PORT_REGISTERING,
|
||||
PORT_REGISTERED,
|
||||
PORT_UNREGISTERING,
|
||||
};
|
||||
|
||||
/**
|
||||
* usb_serial_port: structure for the specific ports of a device.
|
||||
* @serial: pointer back to the struct usb_serial owner of this port.
|
||||
@@ -102,6 +109,7 @@ struct usb_serial_port {
|
||||
char console;
|
||||
unsigned long sysrq; /* sysrq timeout */
|
||||
struct device dev;
|
||||
enum port_dev_state dev_state;
|
||||
};
|
||||
#define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev)
|
||||
|
||||
|
Reference in New Issue
Block a user