aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/cp210x.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 16:23:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-01 16:23:01 -0400
commitd9a807461fc8cc0d6ba589ea0730d139122af012 (patch)
tree9d8c7a044659d821748dd40718a22557c04e4299 /drivers/usb/serial/cp210x.c
parent3498d13b8090c0b0ef911409fbc503a7c4cca6ef (diff)
parent70c048a238c780c226eb4b115ebaa908cb3b34ec (diff)
Merge tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB changes from Greg Kroah-Hartman: "Here is the big USB pull request for 3.7-rc1 There are lots of gadget driver changes (including copying a bunch of files into the drivers/staging/ccg/ directory so that the other gadget drivers can be fixed up properly without breaking that driver), and we remove the old obsolete ub.c driver from the tree. There are also the usual XHCI set of updates, and other various driver changes and updates. We also are trying hard to remove the old dbg() macro, but the final bits of that removal will be coming in through the networking tree before we can delete it for good. All of these patches have been in the linux-next tree. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up several annoying - but fairly mindless - conflicts due to the termios structure having moved into the tty device, and often clashing with dbg -> dev_dbg conversion. * tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (339 commits) USB: ezusb: move ezusb.c from drivers/usb/serial to drivers/usb/misc USB: uas: fix gcc warning USB: uas: fix locking USB: Fix race condition when removing host controllers USB: uas: add locking USB: uas: fix abort USB: uas: remove aborted field, replace with status bit. USB: uas: fix task management USB: uas: keep track of command urbs xhci: Intel Panther Point BEI quirk. powerpc/usb: remove checking PHY_CLK_VALID for UTMI PHY USB: ftdi_sio: add TIAO USB Multi-Protocol Adapter (TUMPA) support Revert "usb : Add sysfs files to control port power." USB: serial: remove vizzini driver usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems Increase XHCI suspend timeout to 16ms USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq USB: sierra_ms: don't keep unused variable fsl/usb: Add support for USB controller version 2.4 USB: qcaux: add Pantech vendor class match ...
Diffstat (limited to 'drivers/usb/serial/cp210x.c')
-rw-r--r--drivers/usb/serial/cp210x.c141
1 files changed, 64 insertions, 77 deletions
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index ba5e07e188a0..28af5acc3360 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -52,8 +52,6 @@ static int cp210x_startup(struct usb_serial *);
52static void cp210x_release(struct usb_serial *); 52static void cp210x_release(struct usb_serial *);
53static void cp210x_dtr_rts(struct usb_serial_port *p, int on); 53static void cp210x_dtr_rts(struct usb_serial_port *p, int on);
54 54
55static bool debug;
56
57static const struct usb_device_id id_table[] = { 55static const struct usb_device_id id_table[] = {
58 { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */ 56 { USB_DEVICE(0x045B, 0x0053) }, /* Renesas RX610 RX-Stick */
59 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ 57 { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */
@@ -304,9 +302,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
304 kfree(buf); 302 kfree(buf);
305 303
306 if (result != size) { 304 if (result != size) {
307 dbg("%s - Unable to send config request, " 305 dev_dbg(&port->dev, "%s - Unable to send config request, request=0x%x size=%d result=%d\n",
308 "request=0x%x size=%d result=%d", 306 __func__, request, size, result);
309 __func__, request, size, result);
310 if (result > 0) 307 if (result > 0)
311 result = -EPROTO; 308 result = -EPROTO;
312 309
@@ -361,9 +358,8 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
361 kfree(buf); 358 kfree(buf);
362 359
363 if ((size > 2 && result != size) || result < 0) { 360 if ((size > 2 && result != size) || result < 0) {
364 dbg("%s - Unable to send request, " 361 dev_dbg(&port->dev, "%s - Unable to send request, request=0x%x size=%d result=%d\n",
365 "request=0x%x size=%d result=%d", 362 __func__, request, size, result);
366 __func__, request, size, result);
367 if (result > 0) 363 if (result > 0)
368 result = -EPROTO; 364 result = -EPROTO;
369 365
@@ -487,13 +483,14 @@ static void cp210x_get_termios(struct tty_struct *tty,
487static void cp210x_get_termios_port(struct usb_serial_port *port, 483static void cp210x_get_termios_port(struct usb_serial_port *port,
488 unsigned int *cflagp, unsigned int *baudp) 484 unsigned int *cflagp, unsigned int *baudp)
489{ 485{
486 struct device *dev = &port->dev;
490 unsigned int cflag, modem_ctl[4]; 487 unsigned int cflag, modem_ctl[4];
491 unsigned int baud; 488 unsigned int baud;
492 unsigned int bits; 489 unsigned int bits;
493 490
494 cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4); 491 cp210x_get_config(port, CP210X_GET_BAUDRATE, &baud, 4);
495 492
496 dbg("%s - baud rate = %d", __func__, baud); 493 dev_dbg(dev, "%s - baud rate = %d\n", __func__, baud);
497 *baudp = baud; 494 *baudp = baud;
498 495
499 cflag = *cflagp; 496 cflag = *cflagp;
@@ -502,31 +499,30 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
502 cflag &= ~CSIZE; 499 cflag &= ~CSIZE;
503 switch (bits & BITS_DATA_MASK) { 500 switch (bits & BITS_DATA_MASK) {
504 case BITS_DATA_5: 501 case BITS_DATA_5:
505 dbg("%s - data bits = 5", __func__); 502 dev_dbg(dev, "%s - data bits = 5\n", __func__);
506 cflag |= CS5; 503 cflag |= CS5;
507 break; 504 break;
508 case BITS_DATA_6: 505 case BITS_DATA_6:
509 dbg("%s - data bits = 6", __func__); 506 dev_dbg(dev, "%s - data bits = 6\n", __func__);
510 cflag |= CS6; 507 cflag |= CS6;
511 break; 508 break;
512 case BITS_DATA_7: 509 case BITS_DATA_7:
513 dbg("%s - data bits = 7", __func__); 510 dev_dbg(dev, "%s - data bits = 7\n", __func__);
514 cflag |= CS7; 511 cflag |= CS7;
515 break; 512 break;
516 case BITS_DATA_8: 513 case BITS_DATA_8:
517 dbg("%s - data bits = 8", __func__); 514 dev_dbg(dev, "%s - data bits = 8\n", __func__);
518 cflag |= CS8; 515 cflag |= CS8;
519 break; 516 break;
520 case BITS_DATA_9: 517 case BITS_DATA_9:
521 dbg("%s - data bits = 9 (not supported, using 8 data bits)", 518 dev_dbg(dev, "%s - data bits = 9 (not supported, using 8 data bits)\n", __func__);
522 __func__);
523 cflag |= CS8; 519 cflag |= CS8;
524 bits &= ~BITS_DATA_MASK; 520 bits &= ~BITS_DATA_MASK;
525 bits |= BITS_DATA_8; 521 bits |= BITS_DATA_8;
526 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2); 522 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
527 break; 523 break;
528 default: 524 default:
529 dbg("%s - Unknown number of data bits, using 8", __func__); 525 dev_dbg(dev, "%s - Unknown number of data bits, using 8\n", __func__);
530 cflag |= CS8; 526 cflag |= CS8;
531 bits &= ~BITS_DATA_MASK; 527 bits &= ~BITS_DATA_MASK;
532 bits |= BITS_DATA_8; 528 bits |= BITS_DATA_8;
@@ -536,29 +532,29 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
536 532
537 switch (bits & BITS_PARITY_MASK) { 533 switch (bits & BITS_PARITY_MASK) {
538 case BITS_PARITY_NONE: 534 case BITS_PARITY_NONE:
539 dbg("%s - parity = NONE", __func__); 535 dev_dbg(dev, "%s - parity = NONE\n", __func__);
540 cflag &= ~PARENB; 536 cflag &= ~PARENB;
541 break; 537 break;
542 case BITS_PARITY_ODD: 538 case BITS_PARITY_ODD:
543 dbg("%s - parity = ODD", __func__); 539 dev_dbg(dev, "%s - parity = ODD\n", __func__);
544 cflag |= (PARENB|PARODD); 540 cflag |= (PARENB|PARODD);
545 break; 541 break;
546 case BITS_PARITY_EVEN: 542 case BITS_PARITY_EVEN:
547 dbg("%s - parity = EVEN", __func__); 543 dev_dbg(dev, "%s - parity = EVEN\n", __func__);
548 cflag &= ~PARODD; 544 cflag &= ~PARODD;
549 cflag |= PARENB; 545 cflag |= PARENB;
550 break; 546 break;
551 case BITS_PARITY_MARK: 547 case BITS_PARITY_MARK:
552 dbg("%s - parity = MARK", __func__); 548 dev_dbg(dev, "%s - parity = MARK\n", __func__);
553 cflag |= (PARENB|PARODD|CMSPAR); 549 cflag |= (PARENB|PARODD|CMSPAR);
554 break; 550 break;
555 case BITS_PARITY_SPACE: 551 case BITS_PARITY_SPACE:
556 dbg("%s - parity = SPACE", __func__); 552 dev_dbg(dev, "%s - parity = SPACE\n", __func__);
557 cflag &= ~PARODD; 553 cflag &= ~PARODD;
558 cflag |= (PARENB|CMSPAR); 554 cflag |= (PARENB|CMSPAR);
559 break; 555 break;
560 default: 556 default:
561 dbg("%s - Unknown parity mode, disabling parity", __func__); 557 dev_dbg(dev, "%s - Unknown parity mode, disabling parity\n", __func__);
562 cflag &= ~PARENB; 558 cflag &= ~PARENB;
563 bits &= ~BITS_PARITY_MASK; 559 bits &= ~BITS_PARITY_MASK;
564 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2); 560 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
@@ -568,21 +564,19 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
568 cflag &= ~CSTOPB; 564 cflag &= ~CSTOPB;
569 switch (bits & BITS_STOP_MASK) { 565 switch (bits & BITS_STOP_MASK) {
570 case BITS_STOP_1: 566 case BITS_STOP_1:
571 dbg("%s - stop bits = 1", __func__); 567 dev_dbg(dev, "%s - stop bits = 1\n", __func__);
572 break; 568 break;
573 case BITS_STOP_1_5: 569 case BITS_STOP_1_5:
574 dbg("%s - stop bits = 1.5 (not supported, using 1 stop bit)", 570 dev_dbg(dev, "%s - stop bits = 1.5 (not supported, using 1 stop bit)\n", __func__);
575 __func__);
576 bits &= ~BITS_STOP_MASK; 571 bits &= ~BITS_STOP_MASK;
577 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2); 572 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
578 break; 573 break;
579 case BITS_STOP_2: 574 case BITS_STOP_2:
580 dbg("%s - stop bits = 2", __func__); 575 dev_dbg(dev, "%s - stop bits = 2\n", __func__);
581 cflag |= CSTOPB; 576 cflag |= CSTOPB;
582 break; 577 break;
583 default: 578 default:
584 dbg("%s - Unknown number of stop bits, using 1 stop bit", 579 dev_dbg(dev, "%s - Unknown number of stop bits, using 1 stop bit\n", __func__);
585 __func__);
586 bits &= ~BITS_STOP_MASK; 580 bits &= ~BITS_STOP_MASK;
587 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2); 581 cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2);
588 break; 582 break;
@@ -590,10 +584,10 @@ static void cp210x_get_termios_port(struct usb_serial_port *port,
590 584
591 cp210x_get_config(port, CP210X_GET_FLOW, modem_ctl, 16); 585 cp210x_get_config(port, CP210X_GET_FLOW, modem_ctl, 16);
592 if (modem_ctl[0] & 0x0008) { 586 if (modem_ctl[0] & 0x0008) {
593 dbg("%s - flow control = CRTSCTS", __func__); 587 dev_dbg(dev, "%s - flow control = CRTSCTS\n", __func__);
594 cflag |= CRTSCTS; 588 cflag |= CRTSCTS;
595 } else { 589 } else {
596 dbg("%s - flow control = NONE", __func__); 590 dev_dbg(dev, "%s - flow control = NONE\n", __func__);
597 cflag &= ~CRTSCTS; 591 cflag &= ~CRTSCTS;
598 } 592 }
599 593
@@ -640,7 +634,7 @@ static void cp210x_change_speed(struct tty_struct *tty,
640 */ 634 */
641 baud = cp210x_quantise_baudrate(baud); 635 baud = cp210x_quantise_baudrate(baud);
642 636
643 dbg("%s - setting baud rate to %u", __func__, baud); 637 dev_dbg(&port->dev, "%s - setting baud rate to %u\n", __func__, baud);
644 if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, 638 if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud,
645 sizeof(baud))) { 639 sizeof(baud))) {
646 dev_warn(&port->dev, "failed to set baud rate to %u\n", baud); 640 dev_warn(&port->dev, "failed to set baud rate to %u\n", baud);
@@ -656,11 +650,12 @@ static void cp210x_change_speed(struct tty_struct *tty,
656static void cp210x_set_termios(struct tty_struct *tty, 650static void cp210x_set_termios(struct tty_struct *tty,
657 struct usb_serial_port *port, struct ktermios *old_termios) 651 struct usb_serial_port *port, struct ktermios *old_termios)
658{ 652{
653 struct device *dev = &port->dev;
659 unsigned int cflag, old_cflag; 654 unsigned int cflag, old_cflag;
660 unsigned int bits; 655 unsigned int bits;
661 unsigned int modem_ctl[4]; 656 unsigned int modem_ctl[4];
662 657
663 dbg("%s - port %d", __func__, port->number); 658 dev_dbg(dev, "%s - port %d\n", __func__, port->number);
664 659
665 if (!tty) 660 if (!tty)
666 return; 661 return;
@@ -678,34 +673,31 @@ static void cp210x_set_termios(struct tty_struct *tty,
678 switch (cflag & CSIZE) { 673 switch (cflag & CSIZE) {
679 case CS5: 674 case CS5:
680 bits |= BITS_DATA_5; 675 bits |= BITS_DATA_5;
681 dbg("%s - data bits = 5", __func__); 676 dev_dbg(dev, "%s - data bits = 5\n", __func__);
682 break; 677 break;
683 case CS6: 678 case CS6:
684 bits |= BITS_DATA_6; 679 bits |= BITS_DATA_6;
685 dbg("%s - data bits = 6", __func__); 680 dev_dbg(dev, "%s - data bits = 6\n", __func__);
686 break; 681 break;
687 case CS7: 682 case CS7:
688 bits |= BITS_DATA_7; 683 bits |= BITS_DATA_7;
689 dbg("%s - data bits = 7", __func__); 684 dev_dbg(dev, "%s - data bits = 7\n", __func__);
690 break; 685 break;
691 case CS8: 686 case CS8:
692 bits |= BITS_DATA_8; 687 bits |= BITS_DATA_8;
693 dbg("%s - data bits = 8", __func__); 688 dev_dbg(dev, "%s - data bits = 8\n", __func__);
694 break; 689 break;
695 /*case CS9: 690 /*case CS9:
696 bits |= BITS_DATA_9; 691 bits |= BITS_DATA_9;
697 dbg("%s - data bits = 9", __func__); 692 dev_dbg(dev, "%s - data bits = 9\n", __func__);
698 break;*/ 693 break;*/
699 default: 694 default:
700 dbg("cp210x driver does not " 695 dev_dbg(dev, "cp210x driver does not support the number of bits requested, using 8 bit mode\n");
701 "support the number of bits requested,"
702 " using 8 bit mode");
703 bits |= BITS_DATA_8; 696 bits |= BITS_DATA_8;
704 break; 697 break;
705 } 698 }
706 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2)) 699 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2))
707 dbg("Number of data bits requested " 700 dev_dbg(dev, "Number of data bits requested not supported by device\n");
708 "not supported by device");
709 } 701 }
710 702
711 if ((cflag & (PARENB|PARODD|CMSPAR)) != 703 if ((cflag & (PARENB|PARODD|CMSPAR)) !=
@@ -714,25 +706,25 @@ static void cp210x_set_termios(struct tty_struct *tty,
714 bits &= ~BITS_PARITY_MASK; 706 bits &= ~BITS_PARITY_MASK;
715 if (cflag & PARENB) { 707 if (cflag & PARENB) {
716 if (cflag & CMSPAR) { 708 if (cflag & CMSPAR) {
717 if (cflag & PARODD) { 709 if (cflag & PARODD) {
718 bits |= BITS_PARITY_MARK; 710 bits |= BITS_PARITY_MARK;
719 dbg("%s - parity = MARK", __func__); 711 dev_dbg(dev, "%s - parity = MARK\n", __func__);
720 } else { 712 } else {
721 bits |= BITS_PARITY_SPACE; 713 bits |= BITS_PARITY_SPACE;
722 dbg("%s - parity = SPACE", __func__); 714 dev_dbg(dev, "%s - parity = SPACE\n", __func__);
723 } 715 }
724 } else { 716 } else {
725 if (cflag & PARODD) { 717 if (cflag & PARODD) {
726 bits |= BITS_PARITY_ODD; 718 bits |= BITS_PARITY_ODD;
727 dbg("%s - parity = ODD", __func__); 719 dev_dbg(dev, "%s - parity = ODD\n", __func__);
728 } else { 720 } else {
729 bits |= BITS_PARITY_EVEN; 721 bits |= BITS_PARITY_EVEN;
730 dbg("%s - parity = EVEN", __func__); 722 dev_dbg(dev, "%s - parity = EVEN\n", __func__);
731 } 723 }
732 } 724 }
733 } 725 }
734 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2)) 726 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2))
735 dbg("Parity mode not supported by device"); 727 dev_dbg(dev, "Parity mode not supported by device\n");
736 } 728 }
737 729
738 if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) { 730 if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
@@ -740,37 +732,36 @@ static void cp210x_set_termios(struct tty_struct *tty,
740 bits &= ~BITS_STOP_MASK; 732 bits &= ~BITS_STOP_MASK;
741 if (cflag & CSTOPB) { 733 if (cflag & CSTOPB) {
742 bits |= BITS_STOP_2; 734 bits |= BITS_STOP_2;
743 dbg("%s - stop bits = 2", __func__); 735 dev_dbg(dev, "%s - stop bits = 2\n", __func__);
744 } else { 736 } else {
745 bits |= BITS_STOP_1; 737 bits |= BITS_STOP_1;
746 dbg("%s - stop bits = 1", __func__); 738 dev_dbg(dev, "%s - stop bits = 1\n", __func__);
747 } 739 }
748 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2)) 740 if (cp210x_set_config(port, CP210X_SET_LINE_CTL, &bits, 2))
749 dbg("Number of stop bits requested " 741 dev_dbg(dev, "Number of stop bits requested not supported by device\n");
750 "not supported by device");
751 } 742 }
752 743
753 if ((cflag & CRTSCTS) != (old_cflag & CRTSCTS)) { 744 if ((cflag & CRTSCTS) != (old_cflag & CRTSCTS)) {
754 cp210x_get_config(port, CP210X_GET_FLOW, modem_ctl, 16); 745 cp210x_get_config(port, CP210X_GET_FLOW, modem_ctl, 16);
755 dbg("%s - read modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x", 746 dev_dbg(dev, "%s - read modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x\n",
756 __func__, modem_ctl[0], modem_ctl[1], 747 __func__, modem_ctl[0], modem_ctl[1],
757 modem_ctl[2], modem_ctl[3]); 748 modem_ctl[2], modem_ctl[3]);
758 749
759 if (cflag & CRTSCTS) { 750 if (cflag & CRTSCTS) {
760 modem_ctl[0] &= ~0x7B; 751 modem_ctl[0] &= ~0x7B;
761 modem_ctl[0] |= 0x09; 752 modem_ctl[0] |= 0x09;
762 modem_ctl[1] = 0x80; 753 modem_ctl[1] = 0x80;
763 dbg("%s - flow control = CRTSCTS", __func__); 754 dev_dbg(dev, "%s - flow control = CRTSCTS\n", __func__);
764 } else { 755 } else {
765 modem_ctl[0] &= ~0x7B; 756 modem_ctl[0] &= ~0x7B;
766 modem_ctl[0] |= 0x01; 757 modem_ctl[0] |= 0x01;
767 modem_ctl[1] |= 0x40; 758 modem_ctl[1] |= 0x40;
768 dbg("%s - flow control = NONE", __func__); 759 dev_dbg(dev, "%s - flow control = NONE\n", __func__);
769 } 760 }
770 761
771 dbg("%s - write modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x", 762 dev_dbg(dev, "%s - write modem controls = 0x%.4x 0x%.4x 0x%.4x 0x%.4x\n",
772 __func__, modem_ctl[0], modem_ctl[1], 763 __func__, modem_ctl[0], modem_ctl[1],
773 modem_ctl[2], modem_ctl[3]); 764 modem_ctl[2], modem_ctl[3]);
774 cp210x_set_config(port, CP210X_SET_FLOW, modem_ctl, 16); 765 cp210x_set_config(port, CP210X_SET_FLOW, modem_ctl, 16);
775 } 766 }
776 767
@@ -805,7 +796,7 @@ static int cp210x_tiocmset_port(struct usb_serial_port *port,
805 control |= CONTROL_WRITE_DTR; 796 control |= CONTROL_WRITE_DTR;
806 } 797 }
807 798
808 dbg("%s - control = 0x%.4x", __func__, control); 799 dev_dbg(&port->dev, "%s - control = 0x%.4x\n", __func__, control);
809 800
810 return cp210x_set_config(port, CP210X_SET_MHS, &control, 2); 801 return cp210x_set_config(port, CP210X_SET_MHS, &control, 2);
811} 802}
@@ -833,7 +824,7 @@ static int cp210x_tiocmget (struct tty_struct *tty)
833 |((control & CONTROL_RING)? TIOCM_RI : 0) 824 |((control & CONTROL_RING)? TIOCM_RI : 0)
834 |((control & CONTROL_DCD) ? TIOCM_CD : 0); 825 |((control & CONTROL_DCD) ? TIOCM_CD : 0);
835 826
836 dbg("%s - control = 0x%.2x", __func__, control); 827 dev_dbg(&port->dev, "%s - control = 0x%.2x\n", __func__, control);
837 828
838 return result; 829 return result;
839} 830}
@@ -847,8 +838,8 @@ static void cp210x_break_ctl (struct tty_struct *tty, int break_state)
847 state = BREAK_OFF; 838 state = BREAK_OFF;
848 else 839 else
849 state = BREAK_ON; 840 state = BREAK_ON;
850 dbg("%s - turning break %s", __func__, 841 dev_dbg(&port->dev, "%s - turning break %s\n", __func__,
851 state == BREAK_OFF ? "off" : "on"); 842 state == BREAK_OFF ? "off" : "on");
852 cp210x_set_config(port, CP210X_SET_BREAK, &state, 2); 843 cp210x_set_config(port, CP210X_SET_BREAK, &state, 2);
853} 844}
854 845
@@ -865,7 +856,6 @@ static int cp210x_startup(struct usb_serial *serial)
865 if (!port_priv) 856 if (!port_priv)
866 return -ENOMEM; 857 return -ENOMEM;
867 858
868 memset(port_priv, 0x00, sizeof(*port_priv));
869 port_priv->bInterfaceNumber = 859 port_priv->bInterfaceNumber =
870 serial->interface->cur_altsetting->desc.bInterfaceNumber; 860 serial->interface->cur_altsetting->desc.bInterfaceNumber;
871 861
@@ -892,6 +882,3 @@ module_usb_serial_driver(serial_drivers, id_table);
892MODULE_DESCRIPTION(DRIVER_DESC); 882MODULE_DESCRIPTION(DRIVER_DESC);
893MODULE_VERSION(DRIVER_VERSION); 883MODULE_VERSION(DRIVER_VERSION);
894MODULE_LICENSE("GPL"); 884MODULE_LICENSE("GPL");
895
896module_param(debug, bool, S_IRUGO | S_IWUSR);
897MODULE_PARM_DESC(debug, "Enable verbose debugging messages");