diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:57:18 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 15:39:20 -0500 |
commit | f667ddad41e303ebc2c6d5bf3105dffe2fbdd717 (patch) | |
tree | 4f1391375183b38ef74bafed9a71f7f140c6c510 /drivers/usb/serial/option.c | |
parent | 4d2a7aff1062048ea59214b49ca1d915586d6d6d (diff) |
usb-serial: use new registration API in [n-p]* drivers
This patch (as1527) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
navman, omninet, opticon, option, oti6858, and pl2303.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/option.c')
-rw-r--r-- | drivers/usb/serial/option.c | 27 |
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 | ||
1250 | static struct usb_serial_driver * const serial_drivers[] = { | ||
1251 | &option_1port_device, NULL | ||
1252 | }; | ||
1253 | |||
1252 | static bool debug; | 1254 | static bool debug; |
1253 | 1255 | ||
1254 | /* per port private data */ | 1256 | /* per port private data */ |
@@ -1284,28 +1286,17 @@ struct option_port_private { | |||
1284 | static int __init option_init(void) | 1286 | static 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 | ||
1299 | failed_driver_register: | 1290 | retval = usb_serial_register_drivers(&option_driver, serial_drivers); |
1300 | usb_serial_deregister(&option_1port_device); | 1291 | if (retval == 0) |
1301 | failed_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 | ||
1305 | static void __exit option_exit(void) | 1297 | static 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 | ||
1311 | module_init(option_init); | 1302 | module_init(option_init); |