aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ch341.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-02-23 14:56:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 15:39:17 -0500
commit08a4f6bc2e7046ce50849d7589b7d0763926d808 (patch)
tree9c2f247154db1872ef71e9c5ec8afbdd87e02b83 /drivers/usb/serial/ch341.c
parent765e0ba62613fb90f09c1b5926750df0aa56f349 (diff)
usb-serial: use new registration API in [a-c]* drivers
This patch (as1523) modifies the following usb-serial drivers to utilize the new usb_serial_{de}register_drivers() routines: aircable, ark3116, belkin_sa, ch341, cp210x, cyberjack, and cypress_m8. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ch341.c')
-rw-r--r--drivers/usb/serial/ch341.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index 5e53cc59e652..23de3b039a28 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -625,7 +625,6 @@ static struct usb_driver ch341_driver = {
625 .resume = usb_serial_resume, 625 .resume = usb_serial_resume,
626 .reset_resume = ch341_reset_resume, 626 .reset_resume = ch341_reset_resume,
627 .id_table = id_table, 627 .id_table = id_table,
628 .no_dynamic_id = 1,
629 .supports_autosuspend = 1, 628 .supports_autosuspend = 1,
630}; 629};
631 630
@@ -635,7 +634,6 @@ static struct usb_serial_driver ch341_device = {
635 .name = "ch341-uart", 634 .name = "ch341-uart",
636 }, 635 },
637 .id_table = id_table, 636 .id_table = id_table,
638 .usb_driver = &ch341_driver,
639 .num_ports = 1, 637 .num_ports = 1,
640 .open = ch341_open, 638 .open = ch341_open,
641 .dtr_rts = ch341_dtr_rts, 639 .dtr_rts = ch341_dtr_rts,
@@ -650,23 +648,18 @@ static struct usb_serial_driver ch341_device = {
650 .attach = ch341_attach, 648 .attach = ch341_attach,
651}; 649};
652 650
651static struct usb_serial_driver * const serial_drivers[] = {
652 &ch341_device, NULL
653};
654
653static int __init ch341_init(void) 655static int __init ch341_init(void)
654{ 656{
655 int retval; 657 return usb_serial_register_drivers(&ch341_driver, serial_drivers);
656
657 retval = usb_serial_register(&ch341_device);
658 if (retval)
659 return retval;
660 retval = usb_register(&ch341_driver);
661 if (retval)
662 usb_serial_deregister(&ch341_device);
663 return retval;
664} 658}
665 659
666static void __exit ch341_exit(void) 660static void __exit ch341_exit(void)
667{ 661{
668 usb_deregister(&ch341_driver); 662 usb_serial_deregister_drivers(&ch341_driver, serial_drivers);
669 usb_serial_deregister(&ch341_device);
670} 663}
671 664
672module_init(ch341_init); 665module_init(ch341_init);