aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/ir-usb.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2012-02-23 14:56:57 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 15:39:18 -0500
commit7dbe2460989b10644651e779b17b683627feea48 (patch)
tree51ab97a04dfdcea7e71cbc5e8953efab69714b90 /drivers/usb/serial/ir-usb.c
parent97b6b6d2339f67eb17d954930a908b762af66228 (diff)
usb-serial: use new registration API in [i-j]* drivers
This patch (as1525) modifies the following usb-serial drivers to utilize the new usb_serial_{de}register_drivers() routines: io_edgeport, io_ti, ipaq, ipw, ir-usb, and iuu_phoenix. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/ir-usb.c')
-rw-r--r--drivers/usb/serial/ir-usb.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/usb/serial/ir-usb.c b/drivers/usb/serial/ir-usb.c
index 84a396e83671..84965cd65c76 100644
--- a/drivers/usb/serial/ir-usb.c
+++ b/drivers/usb/serial/ir-usb.c
@@ -82,7 +82,6 @@ static struct usb_driver ir_driver = {
82 .probe = usb_serial_probe, 82 .probe = usb_serial_probe,
83 .disconnect = usb_serial_disconnect, 83 .disconnect = usb_serial_disconnect,
84 .id_table = ir_id_table, 84 .id_table = ir_id_table,
85 .no_dynamic_id = 1,
86}; 85};
87 86
88static struct usb_serial_driver ir_device = { 87static struct usb_serial_driver ir_device = {
@@ -91,7 +90,6 @@ static struct usb_serial_driver ir_device = {
91 .name = "ir-usb", 90 .name = "ir-usb",
92 }, 91 },
93 .description = "IR Dongle", 92 .description = "IR Dongle",
94 .usb_driver = &ir_driver,
95 .id_table = ir_id_table, 93 .id_table = ir_id_table,
96 .num_ports = 1, 94 .num_ports = 1,
97 .set_termios = ir_set_termios, 95 .set_termios = ir_set_termios,
@@ -101,6 +99,10 @@ static struct usb_serial_driver ir_device = {
101 .process_read_urb = ir_process_read_urb, 99 .process_read_urb = ir_process_read_urb,
102}; 100};
103 101
102static struct usb_serial_driver * const serial_drivers[] = {
103 &ir_device, NULL
104};
105
104static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc) 106static inline void irda_usb_dump_class_desc(struct usb_irda_cs_descriptor *desc)
105{ 107{
106 dbg("bLength=%x", desc->bLength); 108 dbg("bLength=%x", desc->bLength);
@@ -445,30 +447,16 @@ static int __init ir_init(void)
445 ir_device.bulk_out_size = buffer_size; 447 ir_device.bulk_out_size = buffer_size;
446 } 448 }
447 449
448 retval = usb_serial_register(&ir_device); 450 retval = usb_serial_register_drivers(&ir_driver, serial_drivers);
449 if (retval) 451 if (retval == 0)
450 goto failed_usb_serial_register; 452 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
451 453 DRIVER_DESC "\n");
452 retval = usb_register(&ir_driver);
453 if (retval)
454 goto failed_usb_register;
455
456 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
457 DRIVER_DESC "\n");
458
459 return 0;
460
461failed_usb_register:
462 usb_serial_deregister(&ir_device);
463
464failed_usb_serial_register:
465 return retval; 454 return retval;
466} 455}
467 456
468static void __exit ir_exit(void) 457static void __exit ir_exit(void)
469{ 458{
470 usb_deregister(&ir_driver); 459 usb_serial_deregister_drivers(&ir_driver, serial_drivers);
471 usb_serial_deregister(&ir_device);
472} 460}
473 461
474 462