aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/whiteheat.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 14:50:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 14:50:35 -0400
commit255b703a341d3eaf3ec74f567c00f085225fc3db (patch)
treea0dde3c6a6ba1bc84e445fe61774a6e3cb7377d8 /drivers/usb/serial/whiteheat.c
parent4f0c64120041fc92a35cd1fe84562b7abcd7aeb7 (diff)
USB: serial: whiteheat.c: remove dbg() usage
dbg() was a very old USB-serial-specific macro. This patch removes it from being used in the driver and uses dev_dbg() instead. CC: Support Department <support@connecttech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/whiteheat.c')
-rw-r--r--drivers/usb/serial/whiteheat.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
index fc72591711e4..d9456b4e5d6e 100644
--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -533,7 +533,7 @@ static int whiteheat_ioctl(struct tty_struct *tty,
533 struct serial_struct serstruct; 533 struct serial_struct serstruct;
534 void __user *user_arg = (void __user *)arg; 534 void __user *user_arg = (void __user *)arg;
535 535
536 dbg("%s - port %d, cmd 0x%.4x", __func__, port->number, cmd); 536 dev_dbg(&port->dev, "%s - cmd 0x%.4x\n", __func__, cmd);
537 537
538 switch (cmd) { 538 switch (cmd) {
539 case TIOCGSERIAL: 539 case TIOCGSERIAL:
@@ -580,7 +580,7 @@ static void command_port_write_callback(struct urb *urb)
580 int status = urb->status; 580 int status = urb->status;
581 581
582 if (status) { 582 if (status) {
583 dbg("nonzero urb status: %d", status); 583 dev_dbg(&urb->dev->dev, "nonzero urb status: %d\n", status);
584 return; 584 return;
585 } 585 }
586} 586}
@@ -596,11 +596,11 @@ static void command_port_read_callback(struct urb *urb)
596 596
597 command_info = usb_get_serial_port_data(command_port); 597 command_info = usb_get_serial_port_data(command_port);
598 if (!command_info) { 598 if (!command_info) {
599 dbg("%s - command_info is NULL, exiting.", __func__); 599 dev_dbg(&urb->dev->dev, "%s - command_info is NULL, exiting.\n", __func__);
600 return; 600 return;
601 } 601 }
602 if (status) { 602 if (status) {
603 dbg("%s - nonzero urb status: %d", __func__, status); 603 dev_dbg(&urb->dev->dev, "%s - nonzero urb status: %d\n", __func__, status);
604 if (status != -ENOENT) 604 if (status != -ENOENT)
605 command_info->command_finished = WHITEHEAT_CMD_FAILURE; 605 command_info->command_finished = WHITEHEAT_CMD_FAILURE;
606 wake_up(&command_info->wait_command); 606 wake_up(&command_info->wait_command);
@@ -619,19 +619,19 @@ static void command_port_read_callback(struct urb *urb)
619 } else if (data[0] == WHITEHEAT_EVENT) { 619 } else if (data[0] == WHITEHEAT_EVENT) {
620 /* These are unsolicited reports from the firmware, hence no 620 /* These are unsolicited reports from the firmware, hence no
621 waiting command to wakeup */ 621 waiting command to wakeup */
622 dbg("%s - event received", __func__); 622 dev_dbg(&urb->dev->dev, "%s - event received\n", __func__);
623 } else if (data[0] == WHITEHEAT_GET_DTR_RTS) { 623 } else if (data[0] == WHITEHEAT_GET_DTR_RTS) {
624 memcpy(command_info->result_buffer, &data[1], 624 memcpy(command_info->result_buffer, &data[1],
625 urb->actual_length - 1); 625 urb->actual_length - 1);
626 command_info->command_finished = WHITEHEAT_CMD_COMPLETE; 626 command_info->command_finished = WHITEHEAT_CMD_COMPLETE;
627 wake_up(&command_info->wait_command); 627 wake_up(&command_info->wait_command);
628 } else 628 } else
629 dbg("%s - bad reply from firmware", __func__); 629 dev_dbg(&urb->dev->dev, "%s - bad reply from firmware\n", __func__);
630 630
631 /* Continue trying to always read */ 631 /* Continue trying to always read */
632 result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC); 632 result = usb_submit_urb(command_port->read_urb, GFP_ATOMIC);
633 if (result) 633 if (result)
634 dbg("%s - failed resubmitting read urb, error %d", 634 dev_dbg(&urb->dev->dev, "%s - failed resubmitting read urb, error %d\n",
635 __func__, result); 635 __func__, result);
636} 636}
637 637
@@ -645,11 +645,12 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
645 struct usb_serial_port *command_port; 645 struct usb_serial_port *command_port;
646 struct whiteheat_command_private *command_info; 646 struct whiteheat_command_private *command_info;
647 struct whiteheat_private *info; 647 struct whiteheat_private *info;
648 struct device *dev = &port->dev;
648 __u8 *transfer_buffer; 649 __u8 *transfer_buffer;
649 int retval = 0; 650 int retval = 0;
650 int t; 651 int t;
651 652
652 dbg("%s - command %d", __func__, command); 653 dev_dbg(dev, "%s - command %d\n", __func__, command);
653 654
654 command_port = port->serial->port[COMMAND_PORT]; 655 command_port = port->serial->port[COMMAND_PORT];
655 command_info = usb_get_serial_port_data(command_port); 656 command_info = usb_get_serial_port_data(command_port);
@@ -662,7 +663,7 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
662 command_port->write_urb->transfer_buffer_length = datasize + 1; 663 command_port->write_urb->transfer_buffer_length = datasize + 1;
663 retval = usb_submit_urb(command_port->write_urb, GFP_NOIO); 664 retval = usb_submit_urb(command_port->write_urb, GFP_NOIO);
664 if (retval) { 665 if (retval) {
665 dbg("%s - submit urb failed", __func__); 666 dev_dbg(dev, "%s - submit urb failed\n", __func__);
666 goto exit; 667 goto exit;
667 } 668 }
668 669
@@ -673,19 +674,19 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
673 usb_kill_urb(command_port->write_urb); 674 usb_kill_urb(command_port->write_urb);
674 675
675 if (command_info->command_finished == false) { 676 if (command_info->command_finished == false) {
676 dbg("%s - command timed out.", __func__); 677 dev_dbg(dev, "%s - command timed out.\n", __func__);
677 retval = -ETIMEDOUT; 678 retval = -ETIMEDOUT;
678 goto exit; 679 goto exit;
679 } 680 }
680 681
681 if (command_info->command_finished == WHITEHEAT_CMD_FAILURE) { 682 if (command_info->command_finished == WHITEHEAT_CMD_FAILURE) {
682 dbg("%s - command failed.", __func__); 683 dev_dbg(dev, "%s - command failed.\n", __func__);
683 retval = -EIO; 684 retval = -EIO;
684 goto exit; 685 goto exit;
685 } 686 }
686 687
687 if (command_info->command_finished == WHITEHEAT_CMD_COMPLETE) { 688 if (command_info->command_finished == WHITEHEAT_CMD_COMPLETE) {
688 dbg("%s - command completed.", __func__); 689 dev_dbg(dev, "%s - command completed.\n", __func__);
689 switch (command) { 690 switch (command) {
690 case WHITEHEAT_GET_DTR_RTS: 691 case WHITEHEAT_GET_DTR_RTS:
691 info = usb_get_serial_port_data(port); 692 info = usb_get_serial_port_data(port);
@@ -723,6 +724,7 @@ static int firm_close(struct usb_serial_port *port)
723static void firm_setup_port(struct tty_struct *tty) 724static void firm_setup_port(struct tty_struct *tty)
724{ 725{
725 struct usb_serial_port *port = tty->driver_data; 726 struct usb_serial_port *port = tty->driver_data;
727 struct device *dev = &port->dev;
726 struct whiteheat_port_settings port_settings; 728 struct whiteheat_port_settings port_settings;
727 unsigned int cflag = tty->termios->c_cflag; 729 unsigned int cflag = tty->termios->c_cflag;
728 730
@@ -736,7 +738,7 @@ static void firm_setup_port(struct tty_struct *tty)
736 default: 738 default:
737 case CS8: port_settings.bits = 8; break; 739 case CS8: port_settings.bits = 8; break;
738 } 740 }
739 dbg("%s - data bits = %d", __func__, port_settings.bits); 741 dev_dbg(dev, "%s - data bits = %d\n", __func__, port_settings.bits);
740 742
741 /* determine the parity */ 743 /* determine the parity */
742 if (cflag & PARENB) 744 if (cflag & PARENB)
@@ -752,14 +754,14 @@ static void firm_setup_port(struct tty_struct *tty)
752 port_settings.parity = WHITEHEAT_PAR_EVEN; 754 port_settings.parity = WHITEHEAT_PAR_EVEN;
753 else 755 else
754 port_settings.parity = WHITEHEAT_PAR_NONE; 756 port_settings.parity = WHITEHEAT_PAR_NONE;
755 dbg("%s - parity = %c", __func__, port_settings.parity); 757 dev_dbg(dev, "%s - parity = %c\n", __func__, port_settings.parity);
756 758
757 /* figure out the stop bits requested */ 759 /* figure out the stop bits requested */
758 if (cflag & CSTOPB) 760 if (cflag & CSTOPB)
759 port_settings.stop = 2; 761 port_settings.stop = 2;
760 else 762 else
761 port_settings.stop = 1; 763 port_settings.stop = 1;
762 dbg("%s - stop bits = %d", __func__, port_settings.stop); 764 dev_dbg(dev, "%s - stop bits = %d\n", __func__, port_settings.stop);
763 765
764 /* figure out the flow control settings */ 766 /* figure out the flow control settings */
765 if (cflag & CRTSCTS) 767 if (cflag & CRTSCTS)
@@ -767,7 +769,7 @@ static void firm_setup_port(struct tty_struct *tty)
767 WHITEHEAT_HFLOW_RTS); 769 WHITEHEAT_HFLOW_RTS);
768 else 770 else
769 port_settings.hflow = WHITEHEAT_HFLOW_NONE; 771 port_settings.hflow = WHITEHEAT_HFLOW_NONE;
770 dbg("%s - hardware flow control = %s %s %s %s", __func__, 772 dev_dbg(dev, "%s - hardware flow control = %s %s %s %s\n", __func__,
771 (port_settings.hflow & WHITEHEAT_HFLOW_CTS) ? "CTS" : "", 773 (port_settings.hflow & WHITEHEAT_HFLOW_CTS) ? "CTS" : "",
772 (port_settings.hflow & WHITEHEAT_HFLOW_RTS) ? "RTS" : "", 774 (port_settings.hflow & WHITEHEAT_HFLOW_RTS) ? "RTS" : "",
773 (port_settings.hflow & WHITEHEAT_HFLOW_DSR) ? "DSR" : "", 775 (port_settings.hflow & WHITEHEAT_HFLOW_DSR) ? "DSR" : "",
@@ -778,16 +780,15 @@ static void firm_setup_port(struct tty_struct *tty)
778 port_settings.sflow = WHITEHEAT_SFLOW_RXTX; 780 port_settings.sflow = WHITEHEAT_SFLOW_RXTX;
779 else 781 else
780 port_settings.sflow = WHITEHEAT_SFLOW_NONE; 782 port_settings.sflow = WHITEHEAT_SFLOW_NONE;
781 dbg("%s - software flow control = %c", __func__, port_settings.sflow); 783 dev_dbg(dev, "%s - software flow control = %c\n", __func__, port_settings.sflow);
782 784
783 port_settings.xon = START_CHAR(tty); 785 port_settings.xon = START_CHAR(tty);
784 port_settings.xoff = STOP_CHAR(tty); 786 port_settings.xoff = STOP_CHAR(tty);
785 dbg("%s - XON = %2x, XOFF = %2x", 787 dev_dbg(dev, "%s - XON = %2x, XOFF = %2x\n", __func__, port_settings.xon, port_settings.xoff);
786 __func__, port_settings.xon, port_settings.xoff);
787 788
788 /* get the baud rate wanted */ 789 /* get the baud rate wanted */
789 port_settings.baud = tty_get_baud_rate(tty); 790 port_settings.baud = tty_get_baud_rate(tty);
790 dbg("%s - baud rate = %d", __func__, port_settings.baud); 791 dev_dbg(dev, "%s - baud rate = %d\n", __func__, port_settings.baud);
791 792
792 /* fixme: should set validated settings */ 793 /* fixme: should set validated settings */
793 tty_encode_baud_rate(tty, port_settings.baud, port_settings.baud); 794 tty_encode_baud_rate(tty, port_settings.baud, port_settings.baud);