aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/generic.c
diff options
context:
space:
mode:
authorJohannes Hölzl <johannes.hoelzl@gmx.de>2006-12-17 15:50:24 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-07 18:44:34 -0500
commitd9b1b787736852f462dbf277b3ca708cbbf693ae (patch)
tree143d154a3f77bb3aff27fb74eed339f2713ed399 /drivers/usb/serial/generic.c
parent93bacefc4cc0b53e1cb6a336d43847154fdf6886 (diff)
USB serial: add driver pointer to all usb-serial drivers
Every usb serial driver should have a pointer to the corresponding usb driver. So the usb serial core can add a new id not only to the usb serial driver, but also to the usb driver. Also the usb drivers of ark3116, mos7720 and mos7840 missed the flag no_dynamic_id=1. This is added now. Signed-off-by: Johannes Hölzl <johannes.hoelzl@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r--drivers/usb/serial/generic.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 36042937e77f..601e0648dec6 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -20,6 +20,10 @@
20#include <linux/usb/serial.h> 20#include <linux/usb/serial.h>
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22 22
23static int generic_probe(struct usb_interface *interface,
24 const struct usb_device_id *id);
25
26
23static int debug; 27static int debug;
24 28
25#ifdef CONFIG_USB_SERIAL_GENERIC 29#ifdef CONFIG_USB_SERIAL_GENERIC
@@ -34,6 +38,21 @@ MODULE_PARM_DESC(product, "User specified USB idProduct");
34 38
35static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ 39static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
36 40
41/* we want to look at all devices, as the vendor/product id can change
42 * depending on the command line argument */
43static struct usb_device_id generic_serial_ids[] = {
44 {.driver_info = 42},
45 {}
46};
47
48static struct usb_driver generic_driver = {
49 .name = "usbserial_generic",
50 .probe = generic_probe,
51 .disconnect = usb_serial_disconnect,
52 .id_table = generic_serial_ids,
53 .no_dynamic_id = 1,
54};
55
37/* All of the device info needed for the Generic Serial Converter */ 56/* All of the device info needed for the Generic Serial Converter */
38struct usb_serial_driver usb_serial_generic_device = { 57struct usb_serial_driver usb_serial_generic_device = {
39 .driver = { 58 .driver = {
@@ -41,6 +60,7 @@ struct usb_serial_driver usb_serial_generic_device = {
41 .name = "generic", 60 .name = "generic",
42 }, 61 },
43 .id_table = generic_device_ids, 62 .id_table = generic_device_ids,
63 .usb_driver = &generic_driver,
44 .num_interrupt_in = NUM_DONT_CARE, 64 .num_interrupt_in = NUM_DONT_CARE,
45 .num_bulk_in = NUM_DONT_CARE, 65 .num_bulk_in = NUM_DONT_CARE,
46 .num_bulk_out = NUM_DONT_CARE, 66 .num_bulk_out = NUM_DONT_CARE,
@@ -48,13 +68,6 @@ struct usb_serial_driver usb_serial_generic_device = {
48 .shutdown = usb_serial_generic_shutdown, 68 .shutdown = usb_serial_generic_shutdown,
49}; 69};
50 70
51/* we want to look at all devices, as the vendor/product id can change
52 * depending on the command line argument */
53static struct usb_device_id generic_serial_ids[] = {
54 {.driver_info = 42},
55 {}
56};
57
58static int generic_probe(struct usb_interface *interface, 71static int generic_probe(struct usb_interface *interface,
59 const struct usb_device_id *id) 72 const struct usb_device_id *id)
60{ 73{
@@ -65,14 +78,6 @@ static int generic_probe(struct usb_interface *interface,
65 return usb_serial_probe(interface, id); 78 return usb_serial_probe(interface, id);
66 return -ENODEV; 79 return -ENODEV;
67} 80}
68
69static struct usb_driver generic_driver = {
70 .name = "usbserial_generic",
71 .probe = generic_probe,
72 .disconnect = usb_serial_disconnect,
73 .id_table = generic_serial_ids,
74 .no_dynamic_id = 1,
75};
76#endif 81#endif
77 82
78int usb_serial_generic_register (int _debug) 83int usb_serial_generic_register (int _debug)