Commit 1ad7604f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: serial: kl5kusb105.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: Oliver Neukum <oliver@neukum.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bfc51614
...@@ -239,7 +239,9 @@ static int klsi_105_startup(struct usb_serial *serial) ...@@ -239,7 +239,9 @@ static int klsi_105_startup(struct usb_serial *serial)
priv = kmalloc(sizeof(struct klsi_105_private), priv = kmalloc(sizeof(struct klsi_105_private),
GFP_KERNEL); GFP_KERNEL);
if (!priv) { if (!priv) {
dbg("%skmalloc for klsi_105_private failed.", __func__); dev_dbg(&serial->interface->dev,
"%s - kmalloc for klsi_105_private failed.\n",
__func__);
i--; i--;
goto err_cleanup; goto err_cleanup;
} }
...@@ -344,14 +346,14 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -344,14 +346,14 @@ static int klsi_105_open(struct tty_struct *tty, struct usb_serial_port *port)
dev_err(&port->dev, "Enabling read failed (error = %d)\n", rc); dev_err(&port->dev, "Enabling read failed (error = %d)\n", rc);
retval = rc; retval = rc;
} else } else
dbg("%s - enabled reading", __func__); dev_dbg(&port->dev, "%s - enabled reading\n", __func__);
rc = klsi_105_get_line_state(port, &line_state); rc = klsi_105_get_line_state(port, &line_state);
if (rc >= 0) { if (rc >= 0) {
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
priv->line_state = line_state; priv->line_state = line_state;
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
dbg("%s - read line state 0x%lx", __func__, line_state); dev_dbg(&port->dev, "%s - read line state 0x%lx\n", __func__, line_state);
retval = 0; retval = 0;
} else } else
retval = rc; retval = rc;
...@@ -421,7 +423,7 @@ static void klsi_105_process_read_urb(struct urb *urb) ...@@ -421,7 +423,7 @@ static void klsi_105_process_read_urb(struct urb *urb)
return; return;
if (urb->actual_length <= KLSI_HDR_LEN) { if (urb->actual_length <= KLSI_HDR_LEN) {
dbg("%s - malformed packet", __func__); dev_dbg(&port->dev, "%s - malformed packet\n", __func__);
return; return;
} }
...@@ -431,7 +433,7 @@ static void klsi_105_process_read_urb(struct urb *urb) ...@@ -431,7 +433,7 @@ static void klsi_105_process_read_urb(struct urb *urb)
len = get_unaligned_le16(data); len = get_unaligned_le16(data);
if (len > urb->actual_length - KLSI_HDR_LEN) { if (len > urb->actual_length - KLSI_HDR_LEN) {
dbg("%s - packet length mismatch", __func__); dev_dbg(&port->dev, "%s - packet length mismatch\n", __func__);
len = urb->actual_length - KLSI_HDR_LEN; len = urb->actual_length - KLSI_HDR_LEN;
} }
...@@ -445,6 +447,7 @@ static void klsi_105_set_termios(struct tty_struct *tty, ...@@ -445,6 +447,7 @@ static void klsi_105_set_termios(struct tty_struct *tty,
struct ktermios *old_termios) struct ktermios *old_termios)
{ {
struct klsi_105_private *priv = usb_get_serial_port_data(port); struct klsi_105_private *priv = usb_get_serial_port_data(port);
struct device *dev = &port->dev;
unsigned int iflag = tty->termios->c_iflag; unsigned int iflag = tty->termios->c_iflag;
unsigned int old_iflag = old_termios->c_iflag; unsigned int old_iflag = old_termios->c_iflag;
unsigned int cflag = tty->termios->c_cflag; unsigned int cflag = tty->termios->c_cflag;
...@@ -455,8 +458,7 @@ static void klsi_105_set_termios(struct tty_struct *tty, ...@@ -455,8 +458,7 @@ static void klsi_105_set_termios(struct tty_struct *tty,
cfg = kmalloc(sizeof(*cfg), GFP_KERNEL); cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
if (!cfg) { if (!cfg) {
dev_err(&port->dev, "%s - out of memory for config buffer.\n", dev_err(dev, "%s - out of memory for config buffer.\n", __func__);
__func__);
return; return;
} }
...@@ -471,7 +473,7 @@ static void klsi_105_set_termios(struct tty_struct *tty, ...@@ -471,7 +473,7 @@ static void klsi_105_set_termios(struct tty_struct *tty,
if ((cflag & CBAUD) != (old_cflag & CBAUD)) { if ((cflag & CBAUD) != (old_cflag & CBAUD)) {
/* reassert DTR and (maybe) RTS on transition from B0 */ /* reassert DTR and (maybe) RTS on transition from B0 */
if ((old_cflag & CBAUD) == B0) { if ((old_cflag & CBAUD) == B0) {
dbg("%s: baud was B0", __func__); dev_dbg(dev, "%s: baud was B0\n", __func__);
#if 0 #if 0
priv->control_state |= TIOCM_DTR; priv->control_state |= TIOCM_DTR;
/* don't set RTS if using hardware flow control */ /* don't set RTS if using hardware flow control */
...@@ -509,14 +511,13 @@ static void klsi_105_set_termios(struct tty_struct *tty, ...@@ -509,14 +511,13 @@ static void klsi_105_set_termios(struct tty_struct *tty,
priv->cfg.baudrate = kl5kusb105a_sio_b115200; priv->cfg.baudrate = kl5kusb105a_sio_b115200;
break; break;
default: default:
dbg("KLSI USB->Serial converter:" dev_dbg(dev, "KLSI USB->Serial converter: unsupported baudrate request, using default of 9600");
" unsupported baudrate request, using default of 9600"); priv->cfg.baudrate = kl5kusb105a_sio_b9600;
priv->cfg.baudrate = kl5kusb105a_sio_b9600;
baud = 9600; baud = 9600;
break; break;
} }
if ((cflag & CBAUD) == B0) { if ((cflag & CBAUD) == B0) {
dbg("%s: baud is B0", __func__); dev_dbg(dev, "%s: baud is B0\n", __func__);
/* Drop RTS and DTR */ /* Drop RTS and DTR */
/* maybe this should be simulated by sending read /* maybe this should be simulated by sending read
* disable and read enable messages? * disable and read enable messages?
...@@ -533,11 +534,11 @@ static void klsi_105_set_termios(struct tty_struct *tty, ...@@ -533,11 +534,11 @@ static void klsi_105_set_termios(struct tty_struct *tty,
/* set the number of data bits */ /* set the number of data bits */
switch (cflag & CSIZE) { switch (cflag & CSIZE) {
case CS5: case CS5:
dbg("%s - 5 bits/byte not supported", __func__); dev_dbg(dev, "%s - 5 bits/byte not supported\n", __func__);
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
goto err; goto err;
case CS6: case CS6:
dbg("%s - 6 bits/byte not supported", __func__); dev_dbg(dev, "%s - 6 bits/byte not supported\n", __func__);
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
goto err; goto err;
case CS7: case CS7:
...@@ -547,8 +548,7 @@ static void klsi_105_set_termios(struct tty_struct *tty, ...@@ -547,8 +548,7 @@ static void klsi_105_set_termios(struct tty_struct *tty,
priv->cfg.databits = kl5kusb105a_dtb_8; priv->cfg.databits = kl5kusb105a_dtb_8;
break; break;
default: default:
dev_err(&port->dev, dev_err(dev, "CSIZE was not CS5-CS8, using default of 8\n");
"CSIZE was not CS5-CS8, using default of 8\n");
priv->cfg.databits = kl5kusb105a_dtb_8; priv->cfg.databits = kl5kusb105a_dtb_8;
break; break;
} }
...@@ -616,7 +616,7 @@ static void mct_u232_break_ctl(struct tty_struct *tty, int break_state) ...@@ -616,7 +616,7 @@ static void mct_u232_break_ctl(struct tty_struct *tty, int break_state)
(struct mct_u232_private *)port->private; (struct mct_u232_private *)port->private;
unsigned char lcr = priv->last_lcr; unsigned char lcr = priv->last_lcr;
dbg("%sstate=%d", __func__, break_state); dev_dbg(&port->dev, "%s - state=%d\n", __func__, break_state);
/* LOCKING */ /* LOCKING */
if (break_state) if (break_state)
...@@ -645,7 +645,7 @@ static int klsi_105_tiocmget(struct tty_struct *tty) ...@@ -645,7 +645,7 @@ static int klsi_105_tiocmget(struct tty_struct *tty)
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
priv->line_state = line_state; priv->line_state = line_state;
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
dbg("%s - read line state 0x%lx", __func__, line_state); dev_dbg(&port->dev, "%s - read line state 0x%lx\n", __func__, line_state);
return (int)line_state; return (int)line_state;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment