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>
This commit is contained in:
parent
f80e866f72
commit
79cbeeaf26
1 changed files with 23 additions and 19 deletions
|
@ -93,8 +93,9 @@ static int ch341_control_out(struct usb_device *dev, u8 request,
|
|||
u16 value, u16 index)
|
||||
{
|
||||
int r;
|
||||
dbg("ch341_control_out(%02x,%02x,%04x,%04x)", USB_DIR_OUT|0x40,
|
||||
(int)request, (int)value, (int)index);
|
||||
|
||||
dev_dbg(&dev->dev, "ch341_control_out(%02x,%02x,%04x,%04x)\n",
|
||||
USB_DIR_OUT|0x40, (int)request, (int)value, (int)index);
|
||||
|
||||
r = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), request,
|
||||
USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
|
||||
|
@ -108,8 +109,10 @@ static int ch341_control_in(struct usb_device *dev,
|
|||
char *buf, unsigned bufsize)
|
||||
{
|
||||
int r;
|
||||
dbg("ch341_control_in(%02x,%02x,%04x,%04x,%p,%u)", USB_DIR_IN|0x40,
|
||||
(int)request, (int)value, (int)index, buf, (int)bufsize);
|
||||
|
||||
dev_dbg(&dev->dev, "ch341_control_in(%02x,%02x,%04x,%04x,%p,%u)\n",
|
||||
USB_DIR_IN|0x40, (int)request, (int)value, (int)index, buf,
|
||||
(int)bufsize);
|
||||
|
||||
r = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), request,
|
||||
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)
|
|||
if (r)
|
||||
goto out;
|
||||
|
||||
dbg("%s - submitting interrupt urb", __func__);
|
||||
dev_dbg(&port->dev, "%s - submitting interrupt urb", __func__);
|
||||
r = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
|
||||
if (r) {
|
||||
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)
|
|||
__func__, r);
|
||||
goto out;
|
||||
}
|
||||
dbg("%s - initial ch341 break register contents - reg1: %x, reg2: %x",
|
||||
__func__, break_reg[0], break_reg[1]);
|
||||
dev_dbg(&port->dev, "%s - initial ch341 break register contents - reg1: %x, reg2: %x\n",
|
||||
__func__, break_reg[0], break_reg[1]);
|
||||
if (break_state != 0) {
|
||||
dbg("%s - Enter break state requested", __func__);
|
||||
dev_dbg(&port->dev, "%s - Enter break state requested\n", __func__);
|
||||
break_reg[0] &= ~CH341_NBREAK_BITS_REG1;
|
||||
break_reg[1] &= ~CH341_NBREAK_BITS_REG2;
|
||||
} else {
|
||||
dbg("%s - Leave break state requested", __func__);
|
||||
dev_dbg(&port->dev, "%s - Leave break state requested\n", __func__);
|
||||
break_reg[0] |= CH341_NBREAK_BITS_REG1;
|
||||
break_reg[1] |= CH341_NBREAK_BITS_REG2;
|
||||
}
|
||||
dbg("%s - New ch341 break register contents - reg1: %x, reg2: %x",
|
||||
__func__, break_reg[0], break_reg[1]);
|
||||
dev_dbg(&port->dev, "%s - New ch341 break register contents - reg1: %x, reg2: %x\n",
|
||||
__func__, break_reg[0], break_reg[1]);
|
||||
reg_contents = get_unaligned_le16(break_reg);
|
||||
r = ch341_control_out(port->serial->dev, CH341_REQ_WRITE_REG,
|
||||
ch341_break_reg, reg_contents);
|
||||
|
@ -451,12 +454,12 @@ static void ch341_read_int_callback(struct urb *urb)
|
|||
case -ENOENT:
|
||||
case -ESHUTDOWN:
|
||||
/* this urb is terminated, clean up */
|
||||
dbg("%s - urb shutting down with status: %d", __func__,
|
||||
urb->status);
|
||||
dev_dbg(&urb->dev->dev, "%s - urb shutting down with status: %d\n",
|
||||
__func__, urb->status);
|
||||
return;
|
||||
default:
|
||||
dbg("%s - nonzero urb status received: %d", __func__,
|
||||
urb->status);
|
||||
dev_dbg(&urb->dev->dev, "%s - nonzero urb status received: %d\n",
|
||||
__func__, urb->status);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
@ -536,15 +539,16 @@ static int ch341_ioctl(struct tty_struct *tty,
|
|||
unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct usb_serial_port *port = tty->driver_data;
|
||||
dbg("%s (%d) cmd = 0x%04x", __func__, port->number, cmd);
|
||||
|
||||
dev_dbg(&port->dev, "%s (%d) cmd = 0x%04x\n", __func__, port->number, cmd);
|
||||
|
||||
switch (cmd) {
|
||||
case TIOCMIWAIT:
|
||||
dbg("%s (%d) TIOCMIWAIT", __func__, port->number);
|
||||
dev_dbg(&port->dev, "%s (%d) TIOCMIWAIT\n", __func__, port->number);
|
||||
return wait_modem_info(port, arg);
|
||||
|
||||
default:
|
||||
dbg("%s not supported = 0x%04x", __func__, cmd);
|
||||
dev_dbg(&port->dev, "%s not supported = 0x%04x\n", __func__, cmd);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -572,7 +576,7 @@ static int ch341_tiocmget(struct tty_struct *tty)
|
|||
| ((status & CH341_BIT_RI) ? TIOCM_RI : 0)
|
||||
| ((status & CH341_BIT_DCD) ? TIOCM_CD : 0);
|
||||
|
||||
dbg("%s - result = %x", __func__, result);
|
||||
dev_dbg(&port->dev, "%s - result = %x\n", __func__, result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue