aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r--drivers/usb/serial/option.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index b54afceb9611..138a7b98cda4 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -1212,7 +1212,6 @@ static struct usb_driver option_driver = {
1212 .supports_autosuspend = 1, 1212 .supports_autosuspend = 1,
1213#endif 1213#endif
1214 .id_table = option_ids, 1214 .id_table = option_ids,
1215 .no_dynamic_id = 1,
1216}; 1215};
1217 1216
1218/* The card has three separate interfaces, which the serial driver 1217/* The card has three separate interfaces, which the serial driver
@@ -1225,7 +1224,6 @@ static struct usb_serial_driver option_1port_device = {
1225 .name = "option1", 1224 .name = "option1",
1226 }, 1225 },
1227 .description = "GSM modem (1-port)", 1226 .description = "GSM modem (1-port)",
1228 .usb_driver = &option_driver,
1229 .id_table = option_ids, 1227 .id_table = option_ids,
1230 .num_ports = 1, 1228 .num_ports = 1,
1231 .probe = option_probe, 1229 .probe = option_probe,
@@ -1249,6 +1247,10 @@ static struct usb_serial_driver option_1port_device = {
1249#endif 1247#endif
1250}; 1248};
1251 1249
1250static struct usb_serial_driver * const serial_drivers[] = {
1251 &option_1port_device, NULL
1252};
1253
1252static bool debug; 1254static bool debug;
1253 1255
1254/* per port private data */ 1256/* per port private data */
@@ -1284,28 +1286,17 @@ struct option_port_private {
1284static int __init option_init(void) 1286static int __init option_init(void)
1285{ 1287{
1286 int retval; 1288 int retval;
1287 retval = usb_serial_register(&option_1port_device);
1288 if (retval)
1289 goto failed_1port_device_register;
1290 retval = usb_register(&option_driver);
1291 if (retval)
1292 goto failed_driver_register;
1293
1294 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1295 DRIVER_DESC "\n");
1296
1297 return 0;
1298 1289
1299failed_driver_register: 1290 retval = usb_serial_register_drivers(&option_driver, serial_drivers);
1300 usb_serial_deregister(&option_1port_device); 1291 if (retval == 0)
1301failed_1port_device_register: 1292 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1293 DRIVER_DESC "\n");
1302 return retval; 1294 return retval;
1303} 1295}
1304 1296
1305static void __exit option_exit(void) 1297static void __exit option_exit(void)
1306{ 1298{
1307 usb_deregister(&option_driver); 1299 usb_serial_deregister_drivers(&option_driver, serial_drivers);
1308 usb_serial_deregister(&option_1port_device);
1309} 1300}
1310 1301
1311module_init(option_init); 1302module_init(option_init);