diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-05-31 17:03:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-13 17:01:56 -0400 |
commit | 0b84704a2d6fdf55a3dcdd2a1f2ac8b48913c84b (patch) | |
tree | 8927ef05a82096047c25a04f1bc7ca3d0f480dbe /drivers/usb/serial | |
parent | 954c3f8a5f1b7716be9eee978b3bc85bae92d7c8 (diff) |
USB: serial-generic: use a single set of device IDs
The usb-serial-generic driver uses different device IDs for its USB
matching and its serial matching. This can lead to problems: The
driver can end up getting bound to a USB interface without being
allowed to bind to the corresponding serial port.
This patch (as1557) fixes the problem by using the same device ID
table (the one that can be altered by the "vendor=" and "product="
module parameters) for both purposes. The unused table is removed.
Now the driver will bind only to the intended devices.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/generic.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 105a6d898ca4..9b026bf7afef 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -39,13 +39,6 @@ MODULE_PARM_DESC(product, "User specified USB idProduct"); | |||
39 | 39 | ||
40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ | 40 | static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ |
41 | 41 | ||
42 | /* we want to look at all devices, as the vendor/product id can change | ||
43 | * depending on the command line argument */ | ||
44 | static const struct usb_device_id generic_serial_ids[] = { | ||
45 | {.driver_info = 42}, | ||
46 | {} | ||
47 | }; | ||
48 | |||
49 | /* All of the device info needed for the Generic Serial Converter */ | 42 | /* All of the device info needed for the Generic Serial Converter */ |
50 | struct usb_serial_driver usb_serial_generic_device = { | 43 | struct usb_serial_driver usb_serial_generic_device = { |
51 | .driver = { | 44 | .driver = { |
@@ -79,7 +72,8 @@ int usb_serial_generic_register(int _debug) | |||
79 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; | 72 | USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; |
80 | 73 | ||
81 | /* register our generic driver with ourselves */ | 74 | /* register our generic driver with ourselves */ |
82 | retval = usb_serial_register_drivers(serial_drivers, "usbserial_generic", generic_serial_ids); | 75 | retval = usb_serial_register_drivers(serial_drivers, |
76 | "usbserial_generic", generic_device_ids); | ||
83 | #endif | 77 | #endif |
84 | return retval; | 78 | return retval; |
85 | } | 79 | } |