Skip to content

Commit

Permalink
USB: remove use of err() in drivers/usb/serial
Browse files Browse the repository at this point in the history
err() is going away, so switch to dev_err() or printk() if it's really
needed.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
gregkh committed Oct 17, 2008
1 parent b887265 commit 194343d
Show file tree
Hide file tree
Showing 21 changed files with 346 additions and 243 deletions.
8 changes: 4 additions & 4 deletions drivers/usb/serial/aircable.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ static void aircable_send(struct usb_serial_port *port)

buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC);
if (!buf) {
err("%s- kzalloc(%d) failed.", __func__,
count + HCI_HEADER_LENGTH);
dev_err(&port->dev, "%s- kzalloc(%d) failed.\n",
__func__, count + HCI_HEADER_LENGTH);
return;
}

Expand Down Expand Up @@ -276,7 +276,7 @@ static void aircable_read(struct work_struct *work)

if (!tty) {
schedule_work(&priv->rx_work);
err("%s - No tty available", __func__);
dev_err(&port->dev, "%s - No tty available\n", __func__);
return ;
}

Expand Down Expand Up @@ -336,7 +336,7 @@ static int aircable_attach(struct usb_serial *serial)

priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL);
if (!priv) {
err("%s- kmalloc(%Zd) failed.", __func__,
dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__,
sizeof(struct aircable_private));
return -ENOMEM;
}
Expand Down
34 changes: 17 additions & 17 deletions drivers/usb/serial/belkin_sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,15 +228,15 @@ static int belkin_sa_open(struct tty_struct *tty,
port->read_urb->dev = port->serial->dev;
retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
if (retval) {
err("usb_submit_urb(read bulk) failed");
dev_err(&port->dev, "usb_submit_urb(read bulk) failed\n");
goto exit;
}

port->interrupt_in_urb->dev = port->serial->dev;
retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
if (retval) {
usb_kill_urb(port->read_urb);
err(" usb_submit_urb(read int) failed");
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
}

exit:
Expand Down Expand Up @@ -342,8 +342,8 @@ static void belkin_sa_read_int_callback(struct urb *urb)
exit:
retval = usb_submit_urb(urb, GFP_ATOMIC);
if (retval)
err("%s - usb_submit_urb failed with result %d",
__func__, retval);
dev_err(&port->dev, "%s - usb_submit_urb failed with "
"result %d\n", __func__, retval);
}

static void belkin_sa_set_termios(struct tty_struct *tty,
Expand Down Expand Up @@ -382,12 +382,12 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
if ((old_cflag & CBAUD) == B0) {
control_state |= (TIOCM_DTR|TIOCM_RTS);
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 1) < 0)
err("Set DTR error");
dev_err(&port->dev, "Set DTR error\n");
/* don't set RTS if using hardware flow control */
if (!(old_cflag & CRTSCTS))
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST
, 1) < 0)
err("Set RTS error");
dev_err(&port->dev, "Set RTS error\n");
}
}

Expand All @@ -403,18 +403,18 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
/* Report the actual baud rate back to the caller */
tty_encode_baud_rate(tty, baud, baud);
if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, urb_value) < 0)
err("Set baudrate error");
dev_err(&port->dev, "Set baudrate error\n");
} else {
/* Disable flow control */
if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST,
BELKIN_SA_FLOW_NONE) < 0)
err("Disable flowcontrol error");
dev_err(&port->dev, "Disable flowcontrol error\n");
/* Drop RTS and DTR */
control_state &= ~(TIOCM_DTR | TIOCM_RTS);
if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0)
err("DTR LOW error");
dev_err(&port->dev, "DTR LOW error\n");
if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, 0) < 0)
err("RTS LOW error");
dev_err(&port->dev, "RTS LOW error\n");
}

/* set the parity */
Expand All @@ -425,7 +425,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
else
urb_value = BELKIN_SA_PARITY_NONE;
if (BSA_USB_CMD(BELKIN_SA_SET_PARITY_REQUEST, urb_value) < 0)
err("Set parity error");
dev_err(&port->dev, "Set parity error\n");
}

/* set the number of data bits */
Expand All @@ -448,7 +448,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
break;
}
if (BSA_USB_CMD(BELKIN_SA_SET_DATA_BITS_REQUEST, urb_value) < 0)
err("Set data bits error");
dev_err(&port->dev, "Set data bits error\n");
}

/* set the number of stop bits */
Expand All @@ -457,7 +457,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
: BELKIN_SA_STOP_BITS(1);
if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST,
urb_value) < 0)
err("Set stop bits error");
dev_err(&port->dev, "Set stop bits error\n");
}

/* Set flow control */
Expand All @@ -478,7 +478,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
urb_value &= ~(BELKIN_SA_FLOW_IRTS);

if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, urb_value) < 0)
err("Set flow control error");
dev_err(&port->dev, "Set flow control error\n");
}

/* save off the modified port settings */
Expand All @@ -494,7 +494,7 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state)
struct usb_serial *serial = port->serial;

if (BSA_USB_CMD(BELKIN_SA_SET_BREAK_REQUEST, break_state ? 1 : 0) < 0)
err("Set break_ctl %d", break_state);
dev_err(&port->dev, "Set break_ctl %d\n", break_state);
}


Expand Down Expand Up @@ -554,13 +554,13 @@ static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file,

retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts);
if (retval < 0) {
err("Set RTS error %d", retval);
dev_err(&port->dev, "Set RTS error %d\n", retval);
goto exit;
}

retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr);
if (retval < 0) {
err("Set DTR error %d", retval);
dev_err(&port->dev, "Set DTR error %d\n", retval);
goto exit;
}
exit:
Expand Down
23 changes: 14 additions & 9 deletions drivers/usb/serial/cyberjack.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ static int cyberjack_startup(struct usb_serial *serial)
result = usb_submit_urb(serial->port[i]->interrupt_in_urb,
GFP_KERNEL);
if (result)
err(" usb_submit_urb(read int) failed");
dev_err(&serial->dev->dev,
"usb_submit_urb(read int) failed\n");
dbg("%s - usb_submit_urb(int urb)", __func__);
}

Expand Down Expand Up @@ -274,8 +275,9 @@ static int cyberjack_write(struct tty_struct *tty,
/* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err("%s - failed submitting write urb, error %d",
__func__, result);
dev_err(&port->dev,
"%s - failed submitting write urb, error %d",
__func__, result);
/* Throw away data. No better idea what to do with it. */
priv->wrfilled = 0;
priv->wrsent = 0;
Expand Down Expand Up @@ -351,7 +353,9 @@ static void cyberjack_read_int_callback(struct urb *urb)
port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err("%s - failed resubmitting read urb, error %d", __func__, result);
dev_err(&port->dev, "%s - failed resubmitting "
"read urb, error %d\n",
__func__, result);
dbg("%s - usb_submit_urb(read urb)", __func__);
}
}
Expand All @@ -360,7 +364,7 @@ static void cyberjack_read_int_callback(struct urb *urb)
port->interrupt_in_urb->dev = port->serial->dev;
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
if (result)
err(" usb_submit_urb(read int) failed");
dev_err(&port->dev, "usb_submit_urb(read int) failed\n");
dbg("%s - usb_submit_urb(int urb)", __func__);
}

Expand Down Expand Up @@ -414,8 +418,8 @@ static void cyberjack_read_bulk_callback(struct urb *urb)
port->read_urb->dev = port->serial->dev;
result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err("%s - failed resubmitting read urb, error %d",
__func__, result);
dev_err(&port->dev, "%s - failed resubmitting read "
"urb, error %d\n", __func__, result);
dbg("%s - usb_submit_urb(read urb)", __func__);
}
}
Expand Down Expand Up @@ -462,8 +466,9 @@ static void cyberjack_write_bulk_callback(struct urb *urb)
/* send the data out the bulk port */
result = usb_submit_urb(port->write_urb, GFP_ATOMIC);
if (result) {
err("%s - failed submitting write urb, error %d",
__func__, result);
dev_err(&port->dev,
"%s - failed submitting write urb, error %d\n",
__func__, result);
/* Throw away data. No better idea what to do with it. */
priv->wrfilled = 0;
priv->wrsent = 0;
Expand Down
18 changes: 10 additions & 8 deletions drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ static int cypress_serial_control(struct tty_struct *tty,
retval != -ENODEV);

if (retval != sizeof(feature_buffer)) {
err("%s - failed sending serial line settings - %d",
__func__, retval);
dev_err(&port->dev, "%s - failed sending serial "
"line settings - %d\n", __func__, retval);
cypress_set_dead(port);
} else {
spin_lock_irqsave(&priv->lock, flags);
Expand Down Expand Up @@ -443,7 +443,8 @@ static int cypress_serial_control(struct tty_struct *tty,
&& retval != -ENODEV);

if (retval != sizeof(feature_buffer)) {
err("%s - failed to retrieve serial line settings - %d", __func__, retval);
dev_err(&port->dev, "%s - failed to retrieve serial "
"line settings - %d\n", __func__, retval);
cypress_set_dead(port);
return retval;
} else {
Expand Down Expand Up @@ -476,8 +477,8 @@ static void cypress_set_dead(struct usb_serial_port *port)
priv->comm_is_ok = 0;
spin_unlock_irqrestore(&priv->lock, flags);

err("cypress_m8 suspending failing port %d - interval might be too short",
port->number);
dev_err(&port->dev, "cypress_m8 suspending failing port %d - "
"interval might be too short\n", port->number);
}


Expand Down Expand Up @@ -679,7 +680,8 @@ static int cypress_open(struct tty_struct *tty,

/* setup the port and start reading from the device */
if (!port->interrupt_in_urb) {
err("%s - interrupt_in_urb is empty!", __func__);
dev_err(&port->dev, "%s - interrupt_in_urb is empty!\n",
__func__);
return -1;
}

Expand Down Expand Up @@ -1107,8 +1109,8 @@ static void cypress_set_termios(struct tty_struct *tty,
data_bits = 3;
break;
default:
err("%s - CSIZE was set, but not CS5-CS8",
__func__);
dev_err(&port->dev, "%s - CSIZE was set, but not CS5-CS8\n",
__func__);
data_bits = 3;
}
spin_lock_irqsave(&priv->lock, flags);
Expand Down
Loading

0 comments on commit 194343d

Please sign in to comment.