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.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index cf3bc30675a1..18c3183be769 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -156,10 +156,12 @@ static void whiteheat_unthrottle (struct usb_serial_port *port);
156static void whiteheat_read_callback (struct urb *urb, struct pt_regs *regs); 156static void whiteheat_read_callback (struct urb *urb, struct pt_regs *regs);
157static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs); 157static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs);
158 158
159static struct usb_serial_device_type whiteheat_fake_device = { 159static struct usb_serial_driver whiteheat_fake_device = {
160 .owner = THIS_MODULE, 160 .driver = {
161 .name = "Connect Tech - WhiteHEAT - (prerenumeration)", 161 .owner = THIS_MODULE,
162 .short_name = "whiteheatnofirm", 162 .name = "whiteheatnofirm",
163 },
164 .description = "Connect Tech - WhiteHEAT - (prerenumeration)",
163 .id_table = id_table_prerenumeration, 165 .id_table = id_table_prerenumeration,
164 .num_interrupt_in = NUM_DONT_CARE, 166 .num_interrupt_in = NUM_DONT_CARE,
165 .num_bulk_in = NUM_DONT_CARE, 167 .num_bulk_in = NUM_DONT_CARE,
@@ -169,10 +171,12 @@ static struct usb_serial_device_type whiteheat_fake_device = {
169 .attach = whiteheat_firmware_attach, 171 .attach = whiteheat_firmware_attach,
170}; 172};
171 173
172static struct usb_serial_device_type whiteheat_device = { 174static struct usb_serial_driver whiteheat_device = {
173 .owner = THIS_MODULE, 175 .driver = {
174 .name = "Connect Tech - WhiteHEAT", 176 .owner = THIS_MODULE,
175 .short_name = "whiteheat", 177 .name = "whiteheat",
178 },
179 .description = "Connect Tech - WhiteHEAT",
176 .id_table = id_table_std, 180 .id_table = id_table_std,
177 .num_interrupt_in = NUM_DONT_CARE, 181 .num_interrupt_in = NUM_DONT_CARE,
178 .num_bulk_in = NUM_DONT_CARE, 182 .num_bulk_in = NUM_DONT_CARE,
@@ -382,10 +386,10 @@ static int whiteheat_attach (struct usb_serial *serial)
382 usb_clear_halt(serial->dev, pipe); 386 usb_clear_halt(serial->dev, pipe);
383 ret = usb_bulk_msg (serial->dev, pipe, command, 2, &alen, COMMAND_TIMEOUT_MS); 387 ret = usb_bulk_msg (serial->dev, pipe, command, 2, &alen, COMMAND_TIMEOUT_MS);
384 if (ret) { 388 if (ret) {
385 err("%s: Couldn't send command [%d]", serial->type->name, ret); 389 err("%s: Couldn't send command [%d]", serial->type->description, ret);
386 goto no_firmware; 390 goto no_firmware;
387 } else if (alen != sizeof(command)) { 391 } else if (alen != sizeof(command)) {
388 err("%s: Send command incomplete [%d]", serial->type->name, alen); 392 err("%s: Send command incomplete [%d]", serial->type->description, alen);
389 goto no_firmware; 393 goto no_firmware;
390 } 394 }
391 395
@@ -394,19 +398,19 @@ static int whiteheat_attach (struct usb_serial *serial)
394 usb_clear_halt(serial->dev, pipe); 398 usb_clear_halt(serial->dev, pipe);
395 ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS); 399 ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS);
396 if (ret) { 400 if (ret) {
397 err("%s: Couldn't get results [%d]", serial->type->name, ret); 401 err("%s: Couldn't get results [%d]", serial->type->description, ret);
398 goto no_firmware; 402 goto no_firmware;
399 } else if (alen != sizeof(result)) { 403 } else if (alen != sizeof(result)) {
400 err("%s: Get results incomplete [%d]", serial->type->name, alen); 404 err("%s: Get results incomplete [%d]", serial->type->description, alen);
401 goto no_firmware; 405 goto no_firmware;
402 } else if (result[0] != command[0]) { 406 } else if (result[0] != command[0]) {
403 err("%s: Command failed [%d]", serial->type->name, result[0]); 407 err("%s: Command failed [%d]", serial->type->description, result[0]);
404 goto no_firmware; 408 goto no_firmware;
405 } 409 }
406 410
407 hw_info = (struct whiteheat_hw_info *)&result[1]; 411 hw_info = (struct whiteheat_hw_info *)&result[1];
408 412
409 info("%s: Driver %s: Firmware v%d.%02d", serial->type->name, 413 info("%s: Driver %s: Firmware v%d.%02d", serial->type->description,
410 DRIVER_VERSION, hw_info->sw_major_rev, hw_info->sw_minor_rev); 414 DRIVER_VERSION, hw_info->sw_major_rev, hw_info->sw_minor_rev);
411 415
412 for (i = 0; i < serial->num_ports; i++) { 416 for (i = 0; i < serial->num_ports; i++) {
@@ -414,7 +418,7 @@ static int whiteheat_attach (struct usb_serial *serial)
414 418
415 info = (struct whiteheat_private *)kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL); 419 info = (struct whiteheat_private *)kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
416 if (info == NULL) { 420 if (info == NULL) {
417 err("%s: Out of memory for port structures\n", serial->type->name); 421 err("%s: Out of memory for port structures\n", serial->type->description);
418 goto no_private; 422 goto no_private;
419 } 423 }
420 424
@@ -484,7 +488,7 @@ static int whiteheat_attach (struct usb_serial *serial)
484 488
485 command_info = (struct whiteheat_command_private *)kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL); 489 command_info = (struct whiteheat_command_private *)kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL);
486 if (command_info == NULL) { 490 if (command_info == NULL) {
487 err("%s: Out of memory for port structures\n", serial->type->name); 491 err("%s: Out of memory for port structures\n", serial->type->description);
488 goto no_command_private; 492 goto no_command_private;
489 } 493 }
490 494
@@ -501,9 +505,9 @@ static int whiteheat_attach (struct usb_serial *serial)
501 505
502no_firmware: 506no_firmware:
503 /* Firmware likely not running */ 507 /* Firmware likely not running */
504 err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->name); 508 err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->description);
505 err("%s: If the firmware is not running (status led not blinking)\n", serial->type->name); 509 err("%s: If the firmware is not running (status led not blinking)\n", serial->type->description);
506 err("%s: please contact support@connecttech.com\n", serial->type->name); 510 err("%s: please contact support@connecttech.com\n", serial->type->description);
507 return -ENODEV; 511 return -ENODEV;
508 512
509no_command_private: 513no_command_private: