aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r--drivers/usb/serial/generic.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 2a2fa2d0489..664deb63807 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -54,7 +54,6 @@ static struct usb_driver generic_driver = {
54 .probe = generic_probe, 54 .probe = generic_probe,
55 .disconnect = usb_serial_disconnect, 55 .disconnect = usb_serial_disconnect,
56 .id_table = generic_serial_ids, 56 .id_table = generic_serial_ids,
57 .no_dynamic_id = 1,
58}; 57};
59 58
60/* All of the device info needed for the Generic Serial Converter */ 59/* All of the device info needed for the Generic Serial Converter */
@@ -64,7 +63,6 @@ struct usb_serial_driver usb_serial_generic_device = {
64 .name = "generic", 63 .name = "generic",
65 }, 64 },
66 .id_table = generic_device_ids, 65 .id_table = generic_device_ids,
67 .usb_driver = &generic_driver,
68 .num_ports = 1, 66 .num_ports = 1,
69 .disconnect = usb_serial_generic_disconnect, 67 .disconnect = usb_serial_generic_disconnect,
70 .release = usb_serial_generic_release, 68 .release = usb_serial_generic_release,
@@ -73,6 +71,10 @@ struct usb_serial_driver usb_serial_generic_device = {
73 .resume = usb_serial_generic_resume, 71 .resume = usb_serial_generic_resume,
74}; 72};
75 73
74static struct usb_serial_driver * const serial_drivers[] = {
75 &usb_serial_generic_device, NULL
76};
77
76static int generic_probe(struct usb_interface *interface, 78static int generic_probe(struct usb_interface *interface,
77 const struct usb_device_id *id) 79 const struct usb_device_id *id)
78{ 80{
@@ -97,13 +99,7 @@ int usb_serial_generic_register(int _debug)
97 USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT; 99 USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT;
98 100
99 /* register our generic driver with ourselves */ 101 /* register our generic driver with ourselves */
100 retval = usb_serial_register(&usb_serial_generic_device); 102 retval = usb_serial_register_drivers(&generic_driver, serial_drivers);
101 if (retval)
102 goto exit;
103 retval = usb_register(&generic_driver);
104 if (retval)
105 usb_serial_deregister(&usb_serial_generic_device);
106exit:
107#endif 103#endif
108 return retval; 104 return retval;
109} 105}
@@ -112,8 +108,7 @@ void usb_serial_generic_deregister(void)
112{ 108{
113#ifdef CONFIG_USB_SERIAL_GENERIC 109#ifdef CONFIG_USB_SERIAL_GENERIC
114 /* remove our generic driver */ 110 /* remove our generic driver */
115 usb_deregister(&generic_driver); 111 usb_serial_deregister_drivers(&generic_driver, serial_drivers);
116 usb_serial_deregister(&usb_serial_generic_device);
117#endif 112#endif
118} 113}
119 114