aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 12:47:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-14 12:47:39 -0400
commitf9dfbebb8b39b692474a30e9430073577dd88d7c (patch)
treee533c48e4300ce900826a7a1356388da8fe284a5 /drivers/usb/serial
parentdfa1c31564404284d4faa694c157192cd64cf6a4 (diff)
USB: serial: digi_acceleport.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: Peter Berger <pberger@brimson.com> CC: Al Borchers <alborchers@steinerpoint.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/digi_acceleport.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index b5cd838093ef..df60a339d6c1 100644
--- a/drivers/usb/serial/digi_acceleport.c
+++ b/drivers/usb/serial/digi_acceleport.c
@@ -404,14 +404,15 @@ static void digi_wakeup_write(struct usb_serial_port *port)
404static int digi_write_oob_command(struct usb_serial_port *port, 404static int digi_write_oob_command(struct usb_serial_port *port,
405 unsigned char *buf, int count, int interruptible) 405 unsigned char *buf, int count, int interruptible)
406{ 406{
407
408 int ret = 0; 407 int ret = 0;
409 int len; 408 int len;
410 struct usb_serial_port *oob_port = (struct usb_serial_port *)((struct digi_serial *)(usb_get_serial_data(port->serial)))->ds_oob_port; 409 struct usb_serial_port *oob_port = (struct usb_serial_port *)((struct digi_serial *)(usb_get_serial_data(port->serial)))->ds_oob_port;
411 struct digi_port *oob_priv = usb_get_serial_port_data(oob_port); 410 struct digi_port *oob_priv = usb_get_serial_port_data(oob_port);
412 unsigned long flags = 0; 411 unsigned long flags = 0;
413 412
414 dbg("digi_write_oob_command: TOP: port=%d, count=%d", oob_priv->dp_port_num, count); 413 dev_dbg(&port->dev,
414 "digi_write_oob_command: TOP: port=%d, count=%d\n",
415 oob_priv->dp_port_num, count);
415 416
416 spin_lock_irqsave(&oob_priv->dp_port_lock, flags); 417 spin_lock_irqsave(&oob_priv->dp_port_lock, flags);
417 while (count > 0) { 418 while (count > 0) {
@@ -467,7 +468,7 @@ static int digi_write_inb_command(struct usb_serial_port *port,
467 unsigned char *data = port->write_urb->transfer_buffer; 468 unsigned char *data = port->write_urb->transfer_buffer;
468 unsigned long flags = 0; 469 unsigned long flags = 0;
469 470
470 dbg("digi_write_inb_command: TOP: port=%d, count=%d", 471 dev_dbg(&port->dev, "digi_write_inb_command: TOP: port=%d, count=%d\n",
471 priv->dp_port_num, count); 472 priv->dp_port_num, count);
472 473
473 if (timeout) 474 if (timeout)
@@ -549,7 +550,8 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
549 unsigned long flags = 0; 550 unsigned long flags = 0;
550 551
551 552
552 dbg("digi_set_modem_signals: TOP: port=%d, modem_signals=0x%x", 553 dev_dbg(&port->dev,
554 "digi_set_modem_signals: TOP: port=%d, modem_signals=0x%x\n",
553 port_priv->dp_port_num, modem_signals); 555 port_priv->dp_port_num, modem_signals);
554 556
555 spin_lock_irqsave(&oob_priv->dp_port_lock, flags); 557 spin_lock_irqsave(&oob_priv->dp_port_lock, flags);
@@ -687,6 +689,7 @@ static void digi_set_termios(struct tty_struct *tty,
687 struct usb_serial_port *port, struct ktermios *old_termios) 689 struct usb_serial_port *port, struct ktermios *old_termios)
688{ 690{
689 struct digi_port *priv = usb_get_serial_port_data(port); 691 struct digi_port *priv = usb_get_serial_port_data(port);
692 struct device *dev = &port->dev;
690 unsigned int iflag = tty->termios->c_iflag; 693 unsigned int iflag = tty->termios->c_iflag;
691 unsigned int cflag = tty->termios->c_cflag; 694 unsigned int cflag = tty->termios->c_cflag;
692 unsigned int old_iflag = old_termios->c_iflag; 695 unsigned int old_iflag = old_termios->c_iflag;
@@ -697,7 +700,9 @@ static void digi_set_termios(struct tty_struct *tty,
697 int i = 0; 700 int i = 0;
698 speed_t baud; 701 speed_t baud;
699 702
700 dbg("digi_set_termios: TOP: port=%d, iflag=0x%x, old_iflag=0x%x, cflag=0x%x, old_cflag=0x%x", priv->dp_port_num, iflag, old_iflag, cflag, old_cflag); 703 dev_dbg(dev,
704 "digi_set_termios: TOP: port=%d, iflag=0x%x, old_iflag=0x%x, cflag=0x%x, old_cflag=0x%x\n",
705 priv->dp_port_num, iflag, old_iflag, cflag, old_cflag);
701 706
702 /* set baud rate */ 707 /* set baud rate */
703 baud = tty_get_baud_rate(tty); 708 baud = tty_get_baud_rate(tty);
@@ -773,7 +778,8 @@ static void digi_set_termios(struct tty_struct *tty,
773 case CS7: arg = DIGI_WORD_SIZE_7; break; 778 case CS7: arg = DIGI_WORD_SIZE_7; break;
774 case CS8: arg = DIGI_WORD_SIZE_8; break; 779 case CS8: arg = DIGI_WORD_SIZE_8; break;
775 default: 780 default:
776 dbg("digi_set_termios: can't handle word size %d", 781 dev_dbg(dev,
782 "digi_set_termios: can't handle word size %d\n",
777 (cflag&CSIZE)); 783 (cflag&CSIZE));
778 break; 784 break;
779 } 785 }
@@ -866,7 +872,7 @@ static void digi_set_termios(struct tty_struct *tty,
866 } 872 }
867 ret = digi_write_oob_command(port, buf, i, 1); 873 ret = digi_write_oob_command(port, buf, i, 1);
868 if (ret != 0) 874 if (ret != 0)
869 dbg("digi_set_termios: write oob failed, ret=%d", ret); 875 dev_dbg(dev, "digi_set_termios: write oob failed, ret=%d\n", ret);
870 tty_encode_baud_rate(tty, baud, baud); 876 tty_encode_baud_rate(tty, baud, baud);
871} 877}
872 878
@@ -922,7 +928,8 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
922 unsigned char *data = port->write_urb->transfer_buffer; 928 unsigned char *data = port->write_urb->transfer_buffer;
923 unsigned long flags = 0; 929 unsigned long flags = 0;
924 930
925 dbg("digi_write: TOP: port=%d, count=%d, in_interrupt=%ld", 931 dev_dbg(&port->dev,
932 "digi_write: TOP: port=%d, count=%d, in_interrupt=%ld\n",
926 priv->dp_port_num, count, in_interrupt()); 933 priv->dp_port_num, count, in_interrupt());
927 934
928 /* copy user data (which can sleep) before getting spin lock */ 935 /* copy user data (which can sleep) before getting spin lock */
@@ -981,7 +988,7 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
981 dev_err_console(port, 988 dev_err_console(port,
982 "%s: usb_submit_urb failed, ret=%d, port=%d\n", 989 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
983 __func__, ret, priv->dp_port_num); 990 __func__, ret, priv->dp_port_num);
984 dbg("digi_write: returning %d", ret); 991 dev_dbg(&port->dev, "digi_write: returning %d\n", ret);
985 return ret; 992 return ret;
986 993
987} 994}
@@ -1012,7 +1019,7 @@ static void digi_write_bulk_callback(struct urb *urb)
1012 1019
1013 /* handle oob callback */ 1020 /* handle oob callback */
1014 if (priv->dp_port_num == serial_priv->ds_oob_port_num) { 1021 if (priv->dp_port_num == serial_priv->ds_oob_port_num) {
1015 dbg("digi_write_bulk_callback: oob callback"); 1022 dev_dbg(&port->dev, "digi_write_bulk_callback: oob callback\n");
1016 spin_lock(&priv->dp_port_lock); 1023 spin_lock(&priv->dp_port_lock);
1017 priv->dp_write_urb_in_use = 0; 1024 priv->dp_write_urb_in_use = 0;
1018 wake_up_interruptible(&port->write_wait); 1025 wake_up_interruptible(&port->write_wait);
@@ -1066,7 +1073,7 @@ static int digi_write_room(struct tty_struct *tty)
1066 room = port->bulk_out_size - 2 - priv->dp_out_buf_len; 1073 room = port->bulk_out_size - 2 - priv->dp_out_buf_len;
1067 1074
1068 spin_unlock_irqrestore(&priv->dp_port_lock, flags); 1075 spin_unlock_irqrestore(&priv->dp_port_lock, flags);
1069 dbg("digi_write_room: port=%d, room=%d", priv->dp_port_num, room); 1076 dev_dbg(&port->dev, "digi_write_room: port=%d, room=%d\n", priv->dp_port_num, room);
1070 return room; 1077 return room;
1071 1078
1072} 1079}
@@ -1077,12 +1084,12 @@ static int digi_chars_in_buffer(struct tty_struct *tty)
1077 struct digi_port *priv = usb_get_serial_port_data(port); 1084 struct digi_port *priv = usb_get_serial_port_data(port);
1078 1085
1079 if (priv->dp_write_urb_in_use) { 1086 if (priv->dp_write_urb_in_use) {
1080 dbg("digi_chars_in_buffer: port=%d, chars=%d", 1087 dev_dbg(&port->dev, "digi_chars_in_buffer: port=%d, chars=%d\n",
1081 priv->dp_port_num, port->bulk_out_size - 2); 1088 priv->dp_port_num, port->bulk_out_size - 2);
1082 /* return(port->bulk_out_size - 2); */ 1089 /* return(port->bulk_out_size - 2); */
1083 return 256; 1090 return 256;
1084 } else { 1091 } else {
1085 dbg("digi_chars_in_buffer: port=%d, chars=%d", 1092 dev_dbg(&port->dev, "digi_chars_in_buffer: port=%d, chars=%d\n",
1086 priv->dp_port_num, priv->dp_out_buf_len); 1093 priv->dp_port_num, priv->dp_out_buf_len);
1087 return priv->dp_out_buf_len; 1094 return priv->dp_out_buf_len;
1088 } 1095 }
@@ -1120,7 +1127,7 @@ static int digi_open(struct tty_struct *tty, struct usb_serial_port *port)
1120 1127
1121 ret = digi_write_oob_command(port, buf, 8, 1); 1128 ret = digi_write_oob_command(port, buf, 8, 1);
1122 if (ret != 0) 1129 if (ret != 0)
1123 dbg("digi_open: write oob failed, ret=%d", ret); 1130 dev_dbg(&port->dev, "digi_open: write oob failed, ret=%d\n", ret);
1124 1131
1125 /* set termios settings */ 1132 /* set termios settings */
1126 if (tty) { 1133 if (tty) {
@@ -1180,7 +1187,7 @@ static void digi_close(struct usb_serial_port *port)
1180 1187
1181 ret = digi_write_oob_command(port, buf, 20, 0); 1188 ret = digi_write_oob_command(port, buf, 20, 0);
1182 if (ret != 0) 1189 if (ret != 0)
1183 dbg("digi_close: write oob failed, ret=%d", ret); 1190 dev_dbg(&port->dev, "digi_close: write oob failed, ret=%d\n", ret);
1184 1191
1185 /* wait for final commands on oob port to complete */ 1192 /* wait for final commands on oob port to complete */
1186 prepare_to_wait(&priv->dp_flush_wait, &wait, 1193 prepare_to_wait(&priv->dp_flush_wait, &wait,
@@ -1448,9 +1455,9 @@ static int digi_read_inb_callback(struct urb *urb)
1448 tty_kref_put(tty); 1455 tty_kref_put(tty);
1449 1456
1450 if (opcode == DIGI_CMD_RECEIVE_DISABLE) 1457 if (opcode == DIGI_CMD_RECEIVE_DISABLE)
1451 dbg("%s: got RECEIVE_DISABLE", __func__); 1458 dev_dbg(&port->dev, "%s: got RECEIVE_DISABLE\n", __func__);
1452 else if (opcode != DIGI_CMD_RECEIVE_DATA) 1459 else if (opcode != DIGI_CMD_RECEIVE_DATA)
1453 dbg("%s: unknown opcode: %d", __func__, opcode); 1460 dev_dbg(&port->dev, "%s: unknown opcode: %d\n", __func__, opcode);
1454 1461
1455 return throttled ? 1 : 0; 1462 return throttled ? 1 : 0;
1456 1463
@@ -1484,7 +1491,7 @@ static int digi_read_oob_callback(struct urb *urb)
1484 status = ((unsigned char *)urb->transfer_buffer)[i++]; 1491 status = ((unsigned char *)urb->transfer_buffer)[i++];
1485 val = ((unsigned char *)urb->transfer_buffer)[i++]; 1492 val = ((unsigned char *)urb->transfer_buffer)[i++];
1486 1493
1487 dbg("digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d", 1494 dev_dbg(&port->dev, "digi_read_oob_callback: opcode=%d, line=%d, status=%d, val=%d\n",
1488 opcode, line, status, val); 1495 opcode, line, status, val);
1489 1496
1490 if (status != 0 || line >= serial->type->num_ports) 1497 if (status != 0 || line >= serial->type->num_ports)