aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/whiteheat.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/whiteheat.c')
-rw-r--r--drivers/usb/serial/whiteheat.c47
1 files changed, 5 insertions, 42 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index 7e0acf5c8e38..407e23c87946 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -83,7 +83,6 @@ static struct usb_driver whiteheat_driver = {
83 .probe = usb_serial_probe, 83 .probe = usb_serial_probe,
84 .disconnect = usb_serial_disconnect, 84 .disconnect = usb_serial_disconnect,
85 .id_table = id_table_combined, 85 .id_table = id_table_combined,
86 .no_dynamic_id = 1,
87}; 86};
88 87
89/* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */ 88/* function prototypes for the Connect Tech WhiteHEAT prerenumeration device */
@@ -121,7 +120,6 @@ static struct usb_serial_driver whiteheat_fake_device = {
121 .name = "whiteheatnofirm", 120 .name = "whiteheatnofirm",
122 }, 121 },
123 .description = "Connect Tech - WhiteHEAT - (prerenumeration)", 122 .description = "Connect Tech - WhiteHEAT - (prerenumeration)",
124 .usb_driver = &whiteheat_driver,
125 .id_table = id_table_prerenumeration, 123 .id_table = id_table_prerenumeration,
126 .num_ports = 1, 124 .num_ports = 1,
127 .probe = whiteheat_firmware_download, 125 .probe = whiteheat_firmware_download,
@@ -134,7 +132,6 @@ static struct usb_serial_driver whiteheat_device = {
134 .name = "whiteheat", 132 .name = "whiteheat",
135 }, 133 },
136 .description = "Connect Tech - WhiteHEAT", 134 .description = "Connect Tech - WhiteHEAT",
137 .usb_driver = &whiteheat_driver,
138 .id_table = id_table_std, 135 .id_table = id_table_std,
139 .num_ports = 4, 136 .num_ports = 4,
140 .attach = whiteheat_attach, 137 .attach = whiteheat_attach,
@@ -155,6 +152,9 @@ static struct usb_serial_driver whiteheat_device = {
155 .write_bulk_callback = whiteheat_write_callback, 152 .write_bulk_callback = whiteheat_write_callback,
156}; 153};
157 154
155static struct usb_serial_driver * const serial_drivers[] = {
156 &whiteheat_fake_device, &whiteheat_device, NULL
157};
158 158
159struct whiteheat_command_private { 159struct whiteheat_command_private {
160 struct mutex mutex; 160 struct mutex mutex;
@@ -740,7 +740,7 @@ static int whiteheat_write(struct tty_struct *tty,
740 urb->transfer_buffer_length = bytes; 740 urb->transfer_buffer_length = bytes;
741 result = usb_submit_urb(urb, GFP_ATOMIC); 741 result = usb_submit_urb(urb, GFP_ATOMIC);
742 if (result) { 742 if (result) {
743 dev_err(&port->dev, 743 dev_err_console(port,
744 "%s - failed submitting write urb, error %d\n", 744 "%s - failed submitting write urb, error %d\n",
745 __func__, result); 745 __func__, result);
746 sent = result; 746 sent = result;
@@ -1454,44 +1454,7 @@ out:
1454 tty_kref_put(tty); 1454 tty_kref_put(tty);
1455} 1455}
1456 1456
1457 1457module_usb_serial_driver(whiteheat_driver, serial_drivers);
1458/*****************************************************************************
1459 * Connect Tech's White Heat module functions
1460 *****************************************************************************/
1461static int __init whiteheat_init(void)
1462{
1463 int retval;
1464 retval = usb_serial_register(&whiteheat_fake_device);
1465 if (retval)
1466 goto failed_fake_register;
1467 retval = usb_serial_register(&whiteheat_device);
1468 if (retval)
1469 goto failed_device_register;
1470 retval = usb_register(&whiteheat_driver);
1471 if (retval)
1472 goto failed_usb_register;
1473 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
1474 DRIVER_DESC "\n");
1475 return 0;
1476failed_usb_register:
1477 usb_serial_deregister(&whiteheat_device);
1478failed_device_register:
1479 usb_serial_deregister(&whiteheat_fake_device);
1480failed_fake_register:
1481 return retval;
1482}
1483
1484
1485static void __exit whiteheat_exit(void)
1486{
1487 usb_deregister(&whiteheat_driver);
1488 usb_serial_deregister(&whiteheat_fake_device);
1489 usb_serial_deregister(&whiteheat_device);
1490}
1491
1492
1493module_init(whiteheat_init);
1494module_exit(whiteheat_exit);
1495 1458
1496MODULE_AUTHOR(DRIVER_AUTHOR); 1459MODULE_AUTHOR(DRIVER_AUTHOR);
1497MODULE_DESCRIPTION(DRIVER_DESC); 1460MODULE_DESCRIPTION(DRIVER_DESC);