diff options
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/keyspan.c | 38 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan.h | 10 | ||||
-rw-r--r-- | drivers/usb/serial/kl5kusb105.c | 28 | ||||
-rw-r--r-- | drivers/usb/serial/kobil_sct.c | 25 | ||||
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 26 | ||||
-rw-r--r-- | drivers/usb/serial/mos7720.c | 32 | ||||
-rw-r--r-- | drivers/usb/serial/mos7840.c | 32 | ||||
-rw-r--r-- | drivers/usb/serial/moto_modem.c | 19 |
8 files changed, 64 insertions, 146 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 4cc36c761801..0d5d3025a663 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -134,45 +134,17 @@ struct keyspan_port_private { | |||
134 | static int __init keyspan_init(void) | 134 | static int __init keyspan_init(void) |
135 | { | 135 | { |
136 | int retval; | 136 | int retval; |
137 | retval = usb_serial_register(&keyspan_pre_device); | ||
138 | if (retval) | ||
139 | goto failed_pre_device_register; | ||
140 | retval = usb_serial_register(&keyspan_1port_device); | ||
141 | if (retval) | ||
142 | goto failed_1port_device_register; | ||
143 | retval = usb_serial_register(&keyspan_2port_device); | ||
144 | if (retval) | ||
145 | goto failed_2port_device_register; | ||
146 | retval = usb_serial_register(&keyspan_4port_device); | ||
147 | if (retval) | ||
148 | goto failed_4port_device_register; | ||
149 | retval = usb_register(&keyspan_driver); | ||
150 | if (retval) | ||
151 | goto failed_usb_register; | ||
152 | |||
153 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
154 | DRIVER_DESC "\n"); | ||
155 | 137 | ||
156 | return 0; | 138 | retval = usb_serial_register_drivers(&keyspan_driver, serial_drivers); |
157 | failed_usb_register: | 139 | if (retval == 0) |
158 | usb_serial_deregister(&keyspan_4port_device); | 140 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
159 | failed_4port_device_register: | 141 | DRIVER_DESC "\n"); |
160 | usb_serial_deregister(&keyspan_2port_device); | ||
161 | failed_2port_device_register: | ||
162 | usb_serial_deregister(&keyspan_1port_device); | ||
163 | failed_1port_device_register: | ||
164 | usb_serial_deregister(&keyspan_pre_device); | ||
165 | failed_pre_device_register: | ||
166 | return retval; | 142 | return retval; |
167 | } | 143 | } |
168 | 144 | ||
169 | static void __exit keyspan_exit(void) | 145 | static void __exit keyspan_exit(void) |
170 | { | 146 | { |
171 | usb_deregister(&keyspan_driver); | 147 | usb_serial_deregister_drivers(&keyspan_driver, serial_drivers); |
172 | usb_serial_deregister(&keyspan_pre_device); | ||
173 | usb_serial_deregister(&keyspan_1port_device); | ||
174 | usb_serial_deregister(&keyspan_2port_device); | ||
175 | usb_serial_deregister(&keyspan_4port_device); | ||
176 | } | 148 | } |
177 | 149 | ||
178 | module_init(keyspan_init); | 150 | module_init(keyspan_init); |
diff --git a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h index 13fa1d1cc900..622853c9e384 100644 --- a/drivers/usb/serial/keyspan.h +++ b/drivers/usb/serial/keyspan.h | |||
@@ -492,7 +492,6 @@ static struct usb_driver keyspan_driver = { | |||
492 | .probe = usb_serial_probe, | 492 | .probe = usb_serial_probe, |
493 | .disconnect = usb_serial_disconnect, | 493 | .disconnect = usb_serial_disconnect, |
494 | .id_table = keyspan_ids_combined, | 494 | .id_table = keyspan_ids_combined, |
495 | .no_dynamic_id = 1, | ||
496 | }; | 495 | }; |
497 | 496 | ||
498 | /* usb_device_id table for the pre-firmware download keyspan devices */ | 497 | /* usb_device_id table for the pre-firmware download keyspan devices */ |
@@ -545,7 +544,6 @@ static struct usb_serial_driver keyspan_pre_device = { | |||
545 | .name = "keyspan_no_firm", | 544 | .name = "keyspan_no_firm", |
546 | }, | 545 | }, |
547 | .description = "Keyspan - (without firmware)", | 546 | .description = "Keyspan - (without firmware)", |
548 | .usb_driver = &keyspan_driver, | ||
549 | .id_table = keyspan_pre_ids, | 547 | .id_table = keyspan_pre_ids, |
550 | .num_ports = 1, | 548 | .num_ports = 1, |
551 | .attach = keyspan_fake_startup, | 549 | .attach = keyspan_fake_startup, |
@@ -557,7 +555,6 @@ static struct usb_serial_driver keyspan_1port_device = { | |||
557 | .name = "keyspan_1", | 555 | .name = "keyspan_1", |
558 | }, | 556 | }, |
559 | .description = "Keyspan 1 port adapter", | 557 | .description = "Keyspan 1 port adapter", |
560 | .usb_driver = &keyspan_driver, | ||
561 | .id_table = keyspan_1port_ids, | 558 | .id_table = keyspan_1port_ids, |
562 | .num_ports = 1, | 559 | .num_ports = 1, |
563 | .open = keyspan_open, | 560 | .open = keyspan_open, |
@@ -580,7 +577,6 @@ static struct usb_serial_driver keyspan_2port_device = { | |||
580 | .name = "keyspan_2", | 577 | .name = "keyspan_2", |
581 | }, | 578 | }, |
582 | .description = "Keyspan 2 port adapter", | 579 | .description = "Keyspan 2 port adapter", |
583 | .usb_driver = &keyspan_driver, | ||
584 | .id_table = keyspan_2port_ids, | 580 | .id_table = keyspan_2port_ids, |
585 | .num_ports = 2, | 581 | .num_ports = 2, |
586 | .open = keyspan_open, | 582 | .open = keyspan_open, |
@@ -603,7 +599,6 @@ static struct usb_serial_driver keyspan_4port_device = { | |||
603 | .name = "keyspan_4", | 599 | .name = "keyspan_4", |
604 | }, | 600 | }, |
605 | .description = "Keyspan 4 port adapter", | 601 | .description = "Keyspan 4 port adapter", |
606 | .usb_driver = &keyspan_driver, | ||
607 | .id_table = keyspan_4port_ids, | 602 | .id_table = keyspan_4port_ids, |
608 | .num_ports = 4, | 603 | .num_ports = 4, |
609 | .open = keyspan_open, | 604 | .open = keyspan_open, |
@@ -620,4 +615,9 @@ static struct usb_serial_driver keyspan_4port_device = { | |||
620 | .release = keyspan_release, | 615 | .release = keyspan_release, |
621 | }; | 616 | }; |
622 | 617 | ||
618 | static struct usb_serial_driver * const serial_drivers[] = { | ||
619 | &keyspan_pre_device, &keyspan_1port_device, | ||
620 | &keyspan_2port_device, &keyspan_4port_device, NULL | ||
621 | }; | ||
622 | |||
623 | #endif | 623 | #endif |
diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index fc064e1442ca..0e65e50edd50 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c | |||
@@ -91,7 +91,6 @@ static struct usb_driver kl5kusb105d_driver = { | |||
91 | .probe = usb_serial_probe, | 91 | .probe = usb_serial_probe, |
92 | .disconnect = usb_serial_disconnect, | 92 | .disconnect = usb_serial_disconnect, |
93 | .id_table = id_table, | 93 | .id_table = id_table, |
94 | .no_dynamic_id = 1, | ||
95 | }; | 94 | }; |
96 | 95 | ||
97 | static struct usb_serial_driver kl5kusb105d_device = { | 96 | static struct usb_serial_driver kl5kusb105d_device = { |
@@ -100,7 +99,6 @@ static struct usb_serial_driver kl5kusb105d_device = { | |||
100 | .name = "kl5kusb105d", | 99 | .name = "kl5kusb105d", |
101 | }, | 100 | }, |
102 | .description = "KL5KUSB105D / PalmConnect", | 101 | .description = "KL5KUSB105D / PalmConnect", |
103 | .usb_driver = &kl5kusb105d_driver, | ||
104 | .id_table = id_table, | 102 | .id_table = id_table, |
105 | .num_ports = 1, | 103 | .num_ports = 1, |
106 | .bulk_out_size = 64, | 104 | .bulk_out_size = 64, |
@@ -118,6 +116,10 @@ static struct usb_serial_driver kl5kusb105d_device = { | |||
118 | .prepare_write_buffer = klsi_105_prepare_write_buffer, | 116 | .prepare_write_buffer = klsi_105_prepare_write_buffer, |
119 | }; | 117 | }; |
120 | 118 | ||
119 | static struct usb_serial_driver * const serial_drivers[] = { | ||
120 | &kl5kusb105d_device, NULL | ||
121 | }; | ||
122 | |||
121 | struct klsi_105_port_settings { | 123 | struct klsi_105_port_settings { |
122 | __u8 pktlen; /* always 5, it seems */ | 124 | __u8 pktlen; /* always 5, it seems */ |
123 | __u8 baudrate; | 125 | __u8 baudrate; |
@@ -694,26 +696,18 @@ static int klsi_105_tiocmset(struct tty_struct *tty, | |||
694 | static int __init klsi_105_init(void) | 696 | static int __init klsi_105_init(void) |
695 | { | 697 | { |
696 | int retval; | 698 | int retval; |
697 | retval = usb_serial_register(&kl5kusb105d_device); | 699 | |
698 | if (retval) | 700 | retval = usb_serial_register_drivers(&kl5kusb105d_driver, |
699 | goto failed_usb_serial_register; | 701 | serial_drivers); |
700 | retval = usb_register(&kl5kusb105d_driver); | 702 | if (retval == 0) |
701 | if (retval) | 703 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
702 | goto failed_usb_register; | 704 | DRIVER_DESC "\n"); |
703 | |||
704 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
705 | DRIVER_DESC "\n"); | ||
706 | return 0; | ||
707 | failed_usb_register: | ||
708 | usb_serial_deregister(&kl5kusb105d_device); | ||
709 | failed_usb_serial_register: | ||
710 | return retval; | 705 | return retval; |
711 | } | 706 | } |
712 | 707 | ||
713 | static void __exit klsi_105_exit(void) | 708 | static void __exit klsi_105_exit(void) |
714 | { | 709 | { |
715 | usb_deregister(&kl5kusb105d_driver); | 710 | usb_serial_deregister_drivers(&kl5kusb105d_driver, serial_drivers); |
716 | usb_serial_deregister(&kl5kusb105d_device); | ||
717 | } | 711 | } |
718 | 712 | ||
719 | 713 | ||
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index a92a3efb507b..a033dd7dc265 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -90,7 +90,6 @@ static struct usb_driver kobil_driver = { | |||
90 | .probe = usb_serial_probe, | 90 | .probe = usb_serial_probe, |
91 | .disconnect = usb_serial_disconnect, | 91 | .disconnect = usb_serial_disconnect, |
92 | .id_table = id_table, | 92 | .id_table = id_table, |
93 | .no_dynamic_id = 1, | ||
94 | }; | 93 | }; |
95 | 94 | ||
96 | 95 | ||
@@ -100,7 +99,6 @@ static struct usb_serial_driver kobil_device = { | |||
100 | .name = "kobil", | 99 | .name = "kobil", |
101 | }, | 100 | }, |
102 | .description = "KOBIL USB smart card terminal", | 101 | .description = "KOBIL USB smart card terminal", |
103 | .usb_driver = &kobil_driver, | ||
104 | .id_table = id_table, | 102 | .id_table = id_table, |
105 | .num_ports = 1, | 103 | .num_ports = 1, |
106 | .attach = kobil_startup, | 104 | .attach = kobil_startup, |
@@ -117,6 +115,9 @@ static struct usb_serial_driver kobil_device = { | |||
117 | .read_int_callback = kobil_read_int_callback, | 115 | .read_int_callback = kobil_read_int_callback, |
118 | }; | 116 | }; |
119 | 117 | ||
118 | static struct usb_serial_driver * const serial_drivers[] = { | ||
119 | &kobil_device, NULL | ||
120 | }; | ||
120 | 121 | ||
121 | struct kobil_private { | 122 | struct kobil_private { |
122 | int write_int_endpoint_address; | 123 | int write_int_endpoint_address; |
@@ -685,28 +686,18 @@ static int kobil_ioctl(struct tty_struct *tty, | |||
685 | static int __init kobil_init(void) | 686 | static int __init kobil_init(void) |
686 | { | 687 | { |
687 | int retval; | 688 | int retval; |
688 | retval = usb_serial_register(&kobil_device); | ||
689 | if (retval) | ||
690 | goto failed_usb_serial_register; | ||
691 | retval = usb_register(&kobil_driver); | ||
692 | if (retval) | ||
693 | goto failed_usb_register; | ||
694 | |||
695 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
696 | DRIVER_DESC "\n"); | ||
697 | 689 | ||
698 | return 0; | 690 | retval = usb_serial_register_drivers(&kobil_driver, serial_drivers); |
699 | failed_usb_register: | 691 | if (retval == 0) |
700 | usb_serial_deregister(&kobil_device); | 692 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
701 | failed_usb_serial_register: | 693 | DRIVER_DESC "\n"); |
702 | return retval; | 694 | return retval; |
703 | } | 695 | } |
704 | 696 | ||
705 | 697 | ||
706 | static void __exit kobil_exit(void) | 698 | static void __exit kobil_exit(void) |
707 | { | 699 | { |
708 | usb_deregister(&kobil_driver); | 700 | usb_serial_deregister_drivers(&kobil_driver, serial_drivers); |
709 | usb_serial_deregister(&kobil_device); | ||
710 | } | 701 | } |
711 | 702 | ||
712 | module_init(kobil_init); | 703 | module_init(kobil_init); |
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 27fa9c8a77b0..6d9a7f8b13db 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c | |||
@@ -88,7 +88,6 @@ static struct usb_driver mct_u232_driver = { | |||
88 | .probe = usb_serial_probe, | 88 | .probe = usb_serial_probe, |
89 | .disconnect = usb_serial_disconnect, | 89 | .disconnect = usb_serial_disconnect, |
90 | .id_table = id_table_combined, | 90 | .id_table = id_table_combined, |
91 | .no_dynamic_id = 1, | ||
92 | }; | 91 | }; |
93 | 92 | ||
94 | static struct usb_serial_driver mct_u232_device = { | 93 | static struct usb_serial_driver mct_u232_device = { |
@@ -97,7 +96,6 @@ static struct usb_serial_driver mct_u232_device = { | |||
97 | .name = "mct_u232", | 96 | .name = "mct_u232", |
98 | }, | 97 | }, |
99 | .description = "MCT U232", | 98 | .description = "MCT U232", |
100 | .usb_driver = &mct_u232_driver, | ||
101 | .id_table = id_table_combined, | 99 | .id_table = id_table_combined, |
102 | .num_ports = 1, | 100 | .num_ports = 1, |
103 | .open = mct_u232_open, | 101 | .open = mct_u232_open, |
@@ -116,6 +114,10 @@ static struct usb_serial_driver mct_u232_device = { | |||
116 | .get_icount = mct_u232_get_icount, | 114 | .get_icount = mct_u232_get_icount, |
117 | }; | 115 | }; |
118 | 116 | ||
117 | static struct usb_serial_driver * const serial_drivers[] = { | ||
118 | &mct_u232_device, NULL | ||
119 | }; | ||
120 | |||
119 | struct mct_u232_private { | 121 | struct mct_u232_private { |
120 | spinlock_t lock; | 122 | spinlock_t lock; |
121 | unsigned int control_state; /* Modem Line Setting (TIOCM) */ | 123 | unsigned int control_state; /* Modem Line Setting (TIOCM) */ |
@@ -907,26 +909,18 @@ static int mct_u232_get_icount(struct tty_struct *tty, | |||
907 | static int __init mct_u232_init(void) | 909 | static int __init mct_u232_init(void) |
908 | { | 910 | { |
909 | int retval; | 911 | int retval; |
910 | retval = usb_serial_register(&mct_u232_device); | 912 | |
911 | if (retval) | 913 | retval = usb_serial_register_drivers(&mct_u232_driver, serial_drivers); |
912 | goto failed_usb_serial_register; | 914 | if (retval == 0) |
913 | retval = usb_register(&mct_u232_driver); | 915 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
914 | if (retval) | 916 | DRIVER_DESC "\n"); |
915 | goto failed_usb_register; | ||
916 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
917 | DRIVER_DESC "\n"); | ||
918 | return 0; | ||
919 | failed_usb_register: | ||
920 | usb_serial_deregister(&mct_u232_device); | ||
921 | failed_usb_serial_register: | ||
922 | return retval; | 917 | return retval; |
923 | } | 918 | } |
924 | 919 | ||
925 | 920 | ||
926 | static void __exit mct_u232_exit(void) | 921 | static void __exit mct_u232_exit(void) |
927 | { | 922 | { |
928 | usb_deregister(&mct_u232_driver); | 923 | usb_serial_deregister_drivers(&mct_u232_driver, serial_drivers); |
929 | usb_serial_deregister(&mct_u232_device); | ||
930 | } | 924 | } |
931 | 925 | ||
932 | module_init(mct_u232_init); | 926 | module_init(mct_u232_init); |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 4fb29b4aaad6..4dfbad80418c 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -2169,7 +2169,6 @@ static struct usb_driver usb_driver = { | |||
2169 | .probe = usb_serial_probe, | 2169 | .probe = usb_serial_probe, |
2170 | .disconnect = usb_serial_disconnect, | 2170 | .disconnect = usb_serial_disconnect, |
2171 | .id_table = moschip_port_id_table, | 2171 | .id_table = moschip_port_id_table, |
2172 | .no_dynamic_id = 1, | ||
2173 | }; | 2172 | }; |
2174 | 2173 | ||
2175 | static struct usb_serial_driver moschip7720_2port_driver = { | 2174 | static struct usb_serial_driver moschip7720_2port_driver = { |
@@ -2178,7 +2177,6 @@ static struct usb_serial_driver moschip7720_2port_driver = { | |||
2178 | .name = "moschip7720", | 2177 | .name = "moschip7720", |
2179 | }, | 2178 | }, |
2180 | .description = "Moschip 2 port adapter", | 2179 | .description = "Moschip 2 port adapter", |
2181 | .usb_driver = &usb_driver, | ||
2182 | .id_table = moschip_port_id_table, | 2180 | .id_table = moschip_port_id_table, |
2183 | .calc_num_ports = mos77xx_calc_num_ports, | 2181 | .calc_num_ports = mos77xx_calc_num_ports, |
2184 | .open = mos7720_open, | 2182 | .open = mos7720_open, |
@@ -2201,38 +2199,26 @@ static struct usb_serial_driver moschip7720_2port_driver = { | |||
2201 | .read_int_callback = NULL /* dynamically assigned in probe() */ | 2199 | .read_int_callback = NULL /* dynamically assigned in probe() */ |
2202 | }; | 2200 | }; |
2203 | 2201 | ||
2202 | static struct usb_serial_driver * const serial_drivers[] = { | ||
2203 | &moschip7720_2port_driver, NULL | ||
2204 | }; | ||
2205 | |||
2204 | static int __init moschip7720_init(void) | 2206 | static int __init moschip7720_init(void) |
2205 | { | 2207 | { |
2206 | int retval; | 2208 | int retval; |
2207 | 2209 | ||
2208 | dbg("%s: Entering ..........", __func__); | 2210 | dbg("%s: Entering ..........", __func__); |
2209 | 2211 | ||
2210 | /* Register with the usb serial */ | 2212 | retval = usb_serial_register_drivers(&usb_driver, serial_drivers); |
2211 | retval = usb_serial_register(&moschip7720_2port_driver); | 2213 | if (retval == 0) |
2212 | if (retval) | 2214 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
2213 | goto failed_port_device_register; | 2215 | DRIVER_DESC "\n"); |
2214 | |||
2215 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
2216 | DRIVER_DESC "\n"); | ||
2217 | |||
2218 | /* Register with the usb */ | ||
2219 | retval = usb_register(&usb_driver); | ||
2220 | if (retval) | ||
2221 | goto failed_usb_register; | ||
2222 | |||
2223 | return 0; | ||
2224 | |||
2225 | failed_usb_register: | ||
2226 | usb_serial_deregister(&moschip7720_2port_driver); | ||
2227 | |||
2228 | failed_port_device_register: | ||
2229 | return retval; | 2216 | return retval; |
2230 | } | 2217 | } |
2231 | 2218 | ||
2232 | static void __exit moschip7720_exit(void) | 2219 | static void __exit moschip7720_exit(void) |
2233 | { | 2220 | { |
2234 | usb_deregister(&usb_driver); | 2221 | usb_serial_deregister_drivers(&usb_driver, serial_drivers); |
2235 | usb_serial_deregister(&moschip7720_2port_driver); | ||
2236 | } | 2222 | } |
2237 | 2223 | ||
2238 | module_init(moschip7720_init); | 2224 | module_init(moschip7720_init); |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 19b11cece6ba..b45522e12f68 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -2638,7 +2638,6 @@ static struct usb_driver io_driver = { | |||
2638 | .probe = usb_serial_probe, | 2638 | .probe = usb_serial_probe, |
2639 | .disconnect = usb_serial_disconnect, | 2639 | .disconnect = usb_serial_disconnect, |
2640 | .id_table = moschip_id_table_combined, | 2640 | .id_table = moschip_id_table_combined, |
2641 | .no_dynamic_id = 1, | ||
2642 | }; | 2641 | }; |
2643 | 2642 | ||
2644 | static struct usb_serial_driver moschip7840_4port_device = { | 2643 | static struct usb_serial_driver moschip7840_4port_device = { |
@@ -2647,7 +2646,6 @@ static struct usb_serial_driver moschip7840_4port_device = { | |||
2647 | .name = "mos7840", | 2646 | .name = "mos7840", |
2648 | }, | 2647 | }, |
2649 | .description = DRIVER_DESC, | 2648 | .description = DRIVER_DESC, |
2650 | .usb_driver = &io_driver, | ||
2651 | .id_table = moschip_port_id_table, | 2649 | .id_table = moschip_port_id_table, |
2652 | .num_ports = 4, | 2650 | .num_ports = 4, |
2653 | .open = mos7840_open, | 2651 | .open = mos7840_open, |
@@ -2674,6 +2672,10 @@ static struct usb_serial_driver moschip7840_4port_device = { | |||
2674 | .read_int_callback = mos7840_interrupt_callback, | 2672 | .read_int_callback = mos7840_interrupt_callback, |
2675 | }; | 2673 | }; |
2676 | 2674 | ||
2675 | static struct usb_serial_driver * const serial_drivers[] = { | ||
2676 | &moschip7840_4port_device, NULL | ||
2677 | }; | ||
2678 | |||
2677 | /**************************************************************************** | 2679 | /**************************************************************************** |
2678 | * moschip7840_init | 2680 | * moschip7840_init |
2679 | * This is called by the module subsystem, or on startup to initialize us | 2681 | * This is called by the module subsystem, or on startup to initialize us |
@@ -2684,24 +2686,12 @@ static int __init moschip7840_init(void) | |||
2684 | 2686 | ||
2685 | dbg("%s", " mos7840_init :entering.........."); | 2687 | dbg("%s", " mos7840_init :entering.........."); |
2686 | 2688 | ||
2687 | /* Register with the usb serial */ | 2689 | retval = usb_serial_register_drivers(&io_driver, serial_drivers); |
2688 | retval = usb_serial_register(&moschip7840_4port_device); | 2690 | if (retval == 0) |
2689 | 2691 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | |
2690 | if (retval) | 2692 | DRIVER_DESC "\n"); |
2691 | goto failed_port_device_register; | ||
2692 | |||
2693 | dbg("%s", "Entering..."); | ||
2694 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
2695 | DRIVER_DESC "\n"); | ||
2696 | 2693 | ||
2697 | /* Register with the usb */ | 2694 | dbg("%s", "Leaving..."); |
2698 | retval = usb_register(&io_driver); | ||
2699 | if (retval == 0) { | ||
2700 | dbg("%s", "Leaving..."); | ||
2701 | return 0; | ||
2702 | } | ||
2703 | usb_serial_deregister(&moschip7840_4port_device); | ||
2704 | failed_port_device_register: | ||
2705 | return retval; | 2695 | return retval; |
2706 | } | 2696 | } |
2707 | 2697 | ||
@@ -2714,9 +2704,7 @@ static void __exit moschip7840_exit(void) | |||
2714 | 2704 | ||
2715 | dbg("%s", " mos7840_exit :entering.........."); | 2705 | dbg("%s", " mos7840_exit :entering.........."); |
2716 | 2706 | ||
2717 | usb_deregister(&io_driver); | 2707 | usb_serial_deregister_drivers(&io_driver, serial_drivers); |
2718 | |||
2719 | usb_serial_deregister(&moschip7840_4port_device); | ||
2720 | 2708 | ||
2721 | dbg("%s", "Entering..."); | 2709 | dbg("%s", "Entering..."); |
2722 | } | 2710 | } |
diff --git a/drivers/usb/serial/moto_modem.c b/drivers/usb/serial/moto_modem.c index e2bfecc46402..0af57d31ab82 100644 --- a/drivers/usb/serial/moto_modem.c +++ b/drivers/usb/serial/moto_modem.c | |||
@@ -36,7 +36,6 @@ static struct usb_driver moto_driver = { | |||
36 | .probe = usb_serial_probe, | 36 | .probe = usb_serial_probe, |
37 | .disconnect = usb_serial_disconnect, | 37 | .disconnect = usb_serial_disconnect, |
38 | .id_table = id_table, | 38 | .id_table = id_table, |
39 | .no_dynamic_id = 1, | ||
40 | }; | 39 | }; |
41 | 40 | ||
42 | static struct usb_serial_driver moto_device = { | 41 | static struct usb_serial_driver moto_device = { |
@@ -45,27 +44,21 @@ static struct usb_serial_driver moto_device = { | |||
45 | .name = "moto-modem", | 44 | .name = "moto-modem", |
46 | }, | 45 | }, |
47 | .id_table = id_table, | 46 | .id_table = id_table, |
48 | .usb_driver = &moto_driver, | ||
49 | .num_ports = 1, | 47 | .num_ports = 1, |
50 | }; | 48 | }; |
51 | 49 | ||
50 | static struct usb_serial_driver * const serial_drivers[] = { | ||
51 | &moto_device, NULL | ||
52 | }; | ||
53 | |||
52 | static int __init moto_init(void) | 54 | static int __init moto_init(void) |
53 | { | 55 | { |
54 | int retval; | 56 | return usb_serial_register_drivers(&moto_driver, serial_drivers); |
55 | |||
56 | retval = usb_serial_register(&moto_device); | ||
57 | if (retval) | ||
58 | return retval; | ||
59 | retval = usb_register(&moto_driver); | ||
60 | if (retval) | ||
61 | usb_serial_deregister(&moto_device); | ||
62 | return retval; | ||
63 | } | 57 | } |
64 | 58 | ||
65 | static void __exit moto_exit(void) | 59 | static void __exit moto_exit(void) |
66 | { | 60 | { |
67 | usb_deregister(&moto_driver); | 61 | usb_serial_deregister_drivers(&moto_driver, serial_drivers); |
68 | usb_serial_deregister(&moto_device); | ||
69 | } | 62 | } |
70 | 63 | ||
71 | module_init(moto_init); | 64 | module_init(moto_init); |