aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-13 20:18:10 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-13 20:18:10 -0400
commit79cbeeaf26b3f8c3e3043e05a8e14ca7e7a49b89 (patch)
treedceefd01af7044cb109c03a887f0feda7fc9282d /drivers/usb/serial
parentf80e866f721942bfd9e5134e17b75f8cf53ebf5c (diff)
USB: serial: ch341.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: Johan Hovold <jhovold@gmail.com> CC: Alan Stern <stern@rowland.harvard.edu> CC: Rusty Russell <rusty@rustcorp.com.au> CC: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/ch341.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
index cabd1b15ddce..9aae210c378f 100644
--- a/drivers/usb/serial/ch341.c
+++ b/drivers/usb/serial/ch341.c
@@ -93,8 +93,9 @@ static int ch341_control_out(struct usb_device *dev, u8 request,
93 u16 value, u16 index) 93 u16 value, u16 index)
94{ 94{
95 int r; 95 int r;
96 dbg("ch341_control_out(%02x,%02x,%04x,%04x)", USB_DIR_OUT|0x40, 96
97 (int)request, (int)value, (int)index); 97 dev_dbg(&dev->dev, "ch341_control_out(%02x,%02x,%04x,%04x)\n",
98 USB_DIR_OUT|0x40, (int)request, (int)value, (int)index);
98 99
99 r = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request, 100 r = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request,
100 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, 101 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
@@ -108,8 +109,10 @@ static int ch341_control_in(struct usb_device *dev,
108 char *buf, unsigned bufsize) 109 char *buf, unsigned bufsize)
109{ 110{
110 int r; 111 int r;
111 dbg("ch341_control_in(%02x,%02x,%04x,%04x,%p,%u)", USB_DIR_IN|0x40, 112
112 (int)request, (int)value, (int)index, buf, (int)bufsize); 113 dev_dbg(&dev->dev, "ch341_control_in(%02x,%02x,%04x,%04x,%p,%u)\n",
114 USB_DIR_IN|0x40, (int)request, (int)value, (int)index, buf,
115 (int)bufsize);
113 116
114 r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request, 117 r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request,
115 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, 118 USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN,
@@ -320,7 +323,7 @@ static int ch341_open(struct tty_struct *tty, struct usb_serial_port *port)
320 if (r) 323 if (r)
321 goto out; 324 goto out;
322 325
323 dbg("%s - submitting interrupt urb", __func__); 326 dev_dbg(&port->dev, "%s - submitting interrupt urb", __func__);
324 r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); 327 r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
325 if (r) { 328 if (r) {
326 dev_err(&port->dev, "%s - failed submitting interrupt urb," 329 dev_err(&port->dev, "%s - failed submitting interrupt urb,"
@@ -390,19 +393,19 @@ static void ch341_break_ctl(struct tty_struct *tty, int break_state)
390 __func__, r); 393 __func__, r);
391 goto out; 394 goto out;
392 } 395 }
393 dbg("%s - initial ch341 break register contents - reg1: %x, reg2: %x", 396 dev_dbg(&port->dev, "%s - initial ch341 break register contents - reg1: %x, reg2: %x\n",
394 __func__, break_reg[0], break_reg[1]); 397 __func__, break_reg[0], break_reg[1]);
395 if (break_state != 0) { 398 if (break_state != 0) {
396 dbg("%s - Enter break state requested", __func__); 399 dev_dbg(&port->dev, "%s - Enter break state requested\n", __func__);
397 break_reg[0] &= ~CH341_NBREAK_BITS_REG1; 400 break_reg[0] &= ~CH341_NBREAK_BITS_REG1;
398 break_reg[1] &= ~CH341_NBREAK_BITS_REG2; 401 break_reg[1] &= ~CH341_NBREAK_BITS_REG2;
399 } else { 402 } else {
400 dbg("%s - Leave break state requested", __func__); 403 dev_dbg(&port->dev, "%s - Leave break state requested\n", __func__);
401 break_reg[0] |= CH341_NBREAK_BITS_REG1; 404 break_reg[0] |= CH341_NBREAK_BITS_REG1;
402 break_reg[1] |= CH341_NBREAK_BITS_REG2; 405 break_reg[1] |= CH341_NBREAK_BITS_REG2;
403 } 406 }
404 dbg("%s - New ch341 break register contents - reg1: %x, reg2: %x", 407 dev_dbg(&port->dev, "%s - New ch341 break register contents - reg1: %x, reg2: %x\n",
405 __func__, break_reg[0], break_reg[1]); 408 __func__, break_reg[0], break_reg[1]);
406 reg_contents = get_unaligned_le16(break_reg); 409 reg_contents = get_unaligned_le16(break_reg);
407 r = ch341_control_out(port->serial->dev, CH341_REQ_WRITE_REG, 410 r = ch341_control_out(port->serial->dev, CH341_REQ_WRITE_REG,
408 ch341_break_reg, reg_contents); 411 ch341_break_reg, reg_contents);
@@ -451,12 +454,12 @@ static void ch341_read_int_callback(struct urb *urb)
451 case -ENOENT: 454 case -ENOENT:
452 case -ESHUTDOWN: 455 case -ESHUTDOWN:
453 /* this urb is terminated, clean up */ 456 /* this urb is terminated, clean up */
454 dbg("%s - urb shutting down with status: %d", __func__, 457 dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n",
455 urb->status); 458 __func__, urb->status);
456 return; 459 return;
457 default: 460 default:
458 dbg("%s - nonzero urb status received: %d", __func__, 461 dev_dbg(&urb->dev->dev, "%s - nonzero urb status received: %d\n",
459 urb->status); 462 __func__, urb->status);
460 goto exit; 463 goto exit;
461 } 464 }
462 465
@@ -536,15 +539,16 @@ static int ch341_ioctl(struct tty_struct *tty,
536 unsigned int cmd, unsigned long arg) 539 unsigned int cmd, unsigned long arg)
537{ 540{
538 struct usb_serial_port *port = tty->driver_data; 541 struct usb_serial_port *port = tty->driver_data;
539 dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd); 542
543 dev_dbg(&port->dev, "%s (%d) cmd = 0x%04x\n", __func__, port->number, cmd);
540 544
541 switch (cmd) { 545 switch (cmd) {
542 case TIOCMIWAIT: 546 case TIOCMIWAIT:
543 dbg("%s (%d) TIOCMIWAIT", __func__, port->number); 547 dev_dbg(&port->dev, "%s (%d) TIOCMIWAIT\n", __func__, port->number);
544 return wait_modem_info(port, arg); 548 return wait_modem_info(port, arg);
545 549
546 default: 550 default:
547 dbg("%s not supported = 0x%04x", __func__, cmd); 551 dev_dbg(&port->dev, "%s not supported = 0x%04x\n", __func__, cmd);
548 break; 552 break;
549 } 553 }
550 554
@@ -572,7 +576,7 @@ static int ch341_tiocmget(struct tty_struct *tty)
572 | ((status & CH341_BIT_RI) ? TIOCM_RI : 0) 576 | ((status & CH341_BIT_RI) ? TIOCM_RI : 0)
573 | ((status & CH341_BIT_DCD) ? TIOCM_CD : 0); 577 | ((status & CH341_BIT_DCD) ? TIOCM_CD : 0);
574 578
575 dbg("%s - result = %x", __func__, result); 579 dev_dbg(&port->dev, "%s - result = %x\n", __func__, result);
576 580
577 return result; 581 return result;
578} 582}