]> git.karo-electronics.de Git - linux-beck.git/commitdiff
USB: serial: ch341.c: remove dbg() usage
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Sep 2012 00:18:10 +0000 (17:18 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Sep 2012 00:18:10 +0000 (17:18 -0700)
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>
drivers/usb/serial/ch341.c

index cabd1b15ddce93029ecd5760a47152144b21eddb..9aae210c378f0ccd1ff50f5f53f2b4eef0247f0d 100644 (file)
@@ -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;
 }