diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-20 16:56:34 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-17 14:41:10 -0700 |
commit | 194343d9364ea07c9f27c4505380a15a905e8a24 (patch) | |
tree | 9c3336daa16fb74f8c669357a7850c2c1452ad8e /drivers | |
parent | b887265c165f94917d0f565b1883a6e7b3c8388c (diff) |
USB: remove use of err() in drivers/usb/serial
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/aircable.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/belkin_sa.c | 34 | ||||
-rw-r--r-- | drivers/usb/serial/cyberjack.c | 23 | ||||
-rw-r--r-- | drivers/usb/serial/cypress_m8.c | 18 | ||||
-rw-r--r-- | drivers/usb/serial/digi_acceleport.c | 65 | ||||
-rw-r--r-- | drivers/usb/serial/empeg.c | 8 | ||||
-rw-r--r-- | drivers/usb/serial/ezusb.c | 3 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 68 | ||||
-rw-r--r-- | drivers/usb/serial/io_edgeport.c | 16 | ||||
-rw-r--r-- | drivers/usb/serial/ipaq.c | 27 | ||||
-rw-r--r-- | drivers/usb/serial/keyspan_pda.c | 14 | ||||
-rw-r--r-- | drivers/usb/serial/kl5kusb105.c | 46 | ||||
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 39 | ||||
-rw-r--r-- | drivers/usb/serial/mos7720.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/mos7840.c | 26 | ||||
-rw-r--r-- | drivers/usb/serial/omninet.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/safe_serial.c | 15 | ||||
-rw-r--r-- | drivers/usb/serial/spcp8x5.c | 7 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 19 | ||||
-rw-r--r-- | drivers/usb/serial/visor.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/whiteheat.c | 113 |
21 files changed, 346 insertions, 243 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c index 99fb7dc59c4..537f953bd7f 100644 --- a/drivers/usb/serial/aircable.c +++ b/drivers/usb/serial/aircable.c @@ -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; } @@ -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 ; } @@ -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; } diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index bb19f1c2e0d..b7eacad4d48 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c @@ -228,7 +228,7 @@ 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; } @@ -236,7 +236,7 @@ static int belkin_sa_open(struct tty_struct *tty, 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: @@ -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, @@ -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"); } } @@ -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 */ @@ -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 */ @@ -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 */ @@ -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 */ @@ -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 */ @@ -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); } @@ -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: diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 068680f9929..858bdd038fb 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -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__); } @@ -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; @@ -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__); } } @@ -360,7 +364,7 @@ resubmit: 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__); } @@ -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__); } } @@ -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; diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index e0ca809f75f..eae4740d448 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c @@ -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); @@ -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 { @@ -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); } @@ -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; } @@ -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); diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index ebc2918719a..69f84f0ea6f 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -661,7 +661,8 @@ static int digi_write_oob_command(struct usb_serial_port *port, } spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); if (ret) - err("%s: usb_submit_urb failed, ret=%d", __func__, ret); + dev_err(&port->dev, "%s: usb_submit_urb failed, ret=%d\n", + __func__, ret); return ret; } @@ -743,7 +744,8 @@ static int digi_write_inb_command(struct usb_serial_port *port, spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret) - err("%s: usb_submit_urb failed, ret=%d, port=%d", + dev_err(&port->dev, + "%s: usb_submit_urb failed, ret=%d, port=%d\n", __func__, ret, priv->dp_port_num); return ret; } @@ -812,7 +814,8 @@ static int digi_set_modem_signals(struct usb_serial_port *port, spin_unlock(&port_priv->dp_port_lock); spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); if (ret) - err("%s: usb_submit_urb failed, ret=%d", __func__, ret); + dev_err(&port->dev, "%s: usb_submit_urb failed, ret=%d\n", + __func__, ret); return ret; } @@ -907,7 +910,8 @@ static void digi_rx_unthrottle(struct tty_struct *tty) spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret) - err("%s: usb_submit_urb failed, ret=%d, port=%d", + dev_err(&port->dev, + "%s: usb_submit_urb failed, ret=%d, port=%d\n", __func__, ret, priv->dp_port_num); } @@ -1214,7 +1218,8 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port, /* return length of new data written, or error */ spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret < 0) - err("%s: usb_submit_urb failed, ret=%d, port=%d", + dev_err(&port->dev, + "%s: usb_submit_urb failed, ret=%d, port=%d\n", __func__, ret, priv->dp_port_num); dbg("digi_write: returning %d", ret); return ret; @@ -1235,14 +1240,16 @@ static void digi_write_bulk_callback(struct urb *urb) /* port and serial sanity check */ if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { - err("%s: port or port->private is NULL, status=%d", - __func__, status); + dev_err(&port->dev, + "%s: port or port->private is NULL, status=%d\n", + __func__, status); return; } serial = port->serial; if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) { - err("%s: serial or serial->private is NULL, status=%d", - __func__, status); + dev_err(&port->dev, + "%s: serial or serial->private is NULL, status=%d\n", + __func__, status); return; } @@ -1284,7 +1291,8 @@ static void digi_write_bulk_callback(struct urb *urb) spin_unlock(&priv->dp_port_lock); if (ret) - err("%s: usb_submit_urb failed, ret=%d, port=%d", + dev_err(&port->dev, + "%s: usb_submit_urb failed, ret=%d, port=%d\n", __func__, ret, priv->dp_port_num); } @@ -1518,8 +1526,9 @@ static int digi_startup_device(struct usb_serial *serial) port->write_urb->dev = port->serial->dev; ret = usb_submit_urb(port->read_urb, GFP_KERNEL); if (ret != 0) { - err("%s: usb_submit_urb failed, ret=%d, port=%d", - __func__, ret, i); + dev_err(&port->dev, + "%s: usb_submit_urb failed, ret=%d, port=%d\n", + __func__, ret, i); break; } } @@ -1618,22 +1627,26 @@ static void digi_read_bulk_callback(struct urb *urb) dbg("digi_read_bulk_callback: TOP"); /* port sanity check, do not resubmit if port is not valid */ - if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { - err("%s: port or port->private is NULL, status=%d", - __func__, status); + if (port == NULL) + return; + priv = usb_get_serial_port_data(port); + if (priv == NULL) { + dev_err(&port->dev, "%s: port->private is NULL, status=%d\n", + __func__, status); return; } if (port->serial == NULL || (serial_priv = usb_get_serial_data(port->serial)) == NULL) { - err("%s: serial is bad or serial->private is NULL, status=%d", - __func__, status); + dev_err(&port->dev, "%s: serial is bad or serial->private " + "is NULL, status=%d\n", __func__, status); return; } /* do not resubmit urb if it has any status error */ if (status) { - err("%s: nonzero read bulk status: status=%d, port=%d", - __func__, status, priv->dp_port_num); + dev_err(&port->dev, + "%s: nonzero read bulk status: status=%d, port=%d\n", + __func__, status, priv->dp_port_num); return; } @@ -1650,8 +1663,9 @@ static void digi_read_bulk_callback(struct urb *urb) urb->dev = port->serial->dev; ret = usb_submit_urb(urb, GFP_ATOMIC); if (ret != 0) { - err("%s: failed resubmitting urb, ret=%d, port=%d", - __func__, ret, priv->dp_port_num); + dev_err(&port->dev, + "%s: failed resubmitting urb, ret=%d, port=%d\n", + __func__, ret, priv->dp_port_num); } } @@ -1687,10 +1701,11 @@ static int digi_read_inb_callback(struct urb *urb) /* short/multiple packet check */ if (urb->actual_length != len + 2) { - err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, " - "port=%d, opcode=%d, len=%d, actual_length=%d, " - "status=%d", __func__, status, priv->dp_port_num, - opcode, len, urb->actual_length, port_status); + dev_err(&port->dev, "%s: INCOMPLETE OR MULTIPLE PACKET, " + "urb->status=%d, port=%d, opcode=%d, len=%d, " + "actual_length=%d, status=%d\n", __func__, status, + priv->dp_port_num, opcode, len, urb->actual_length, + port_status); return -1; } diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index fdd28e940bc..8a69cce40b6 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c @@ -416,7 +416,7 @@ static int empeg_startup(struct usb_serial *serial) dbg("%s", __func__); if (serial->dev->actconfig->desc.bConfigurationValue != 1) { - err("active config #%d != 1 ??", + dev_err(&serial->dev->dev, "active config #%d != 1 ??\n", serial->dev->actconfig->desc.bConfigurationValue); return -ENODEV; } @@ -499,15 +499,15 @@ static int __init empeg_init(void) urb = usb_alloc_urb(0, GFP_KERNEL); write_urb_pool[i] = urb; if (urb == NULL) { - err("No more urbs???"); + printk(KERN_ERR "empeg: No more urbs???\n"); continue; } urb->transfer_buffer = kmalloc(URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL); if (!urb->transfer_buffer) { - err("%s - out of memory for urb buffers.", - __func__); + printk(KERN_ERR "empeg: %s - out of memory for urb " + "buffers.", __func__); continue; } } diff --git a/drivers/usb/serial/ezusb.c b/drivers/usb/serial/ezusb.c index 711e84f6ed8..3cfc762f505 100644 --- a/drivers/usb/serial/ezusb.c +++ b/drivers/usb/serial/ezusb.c @@ -28,7 +28,8 @@ int ezusb_writememory(struct usb_serial *serial, int address, /* dbg("ezusb_writememory %x, %d", address, length); */ if (!serial->dev) { - err("%s - no physical device present, failing.", __func__); + printk(KERN_ERR "ezusb: %s - no physical device present, " + "failing.\n", __func__); return -ENODEV; } diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index bcadb1f4f5d..51d7bdea286 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -1327,7 +1327,7 @@ static int ftdi_sio_port_probe(struct usb_serial_port *port) priv = kzalloc(sizeof(struct ftdi_private), GFP_KERNEL); if (!priv) { - err("%s- kmalloc(%Zd) failed.", __func__, + dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__, sizeof(struct ftdi_private)); return -ENOMEM; } @@ -1524,8 +1524,9 @@ static int ftdi_open(struct tty_struct *tty, ftdi_read_bulk_callback, port); result = usb_submit_urb(port->read_urb, GFP_KERNEL); if (result) - err("%s - failed submitting read urb, error %d", - __func__, result); + dev_err(&port->dev, + "%s - failed submitting read urb, error %d\n", + __func__, result); return result; @@ -1559,7 +1560,7 @@ static void ftdi_close(struct tty_struct *tty, FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 0, priv->interface, buf, 0, WDR_TIMEOUT) < 0) { - err("error from flowcontrol urb"); + dev_err(&port->dev, "error from flowcontrol urb\n"); } /* drop RTS and DTR */ @@ -1624,14 +1625,15 @@ static int ftdi_write(struct tty_struct *tty, struct usb_serial_port *port, buffer = kmalloc(transfer_size, GFP_ATOMIC); if (!buffer) { - err("%s ran out of kernel memory for urb ...", __func__); + dev_err(&port->dev, + "%s ran out of kernel memory for urb ...\n", __func__); count = -ENOMEM; goto error_no_buffer; } urb = usb_alloc_urb(0, GFP_ATOMIC); if (!urb) { - err("%s - no more free urbs", __func__); + dev_err(&port->dev, "%s - no more free urbs\n", __func__); count = -ENOMEM; goto error_no_urb; } @@ -1675,8 +1677,9 @@ static int ftdi_write(struct tty_struct *tty, struct usb_serial_port *port, status = usb_submit_urb(urb, GFP_ATOMIC); if (status) { - err("%s - failed submitting write urb, error %d", - __func__, status); + dev_err(&port->dev, + "%s - failed submitting write urb, error %d\n", + __func__, status); count = status; goto error; } else { @@ -1783,7 +1786,8 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty) buffered = (int)priv->tx_outstanding_bytes; spin_unlock_irqrestore(&priv->tx_lock, flags); if (buffered < 0) { - err("%s outstanding tx bytes is negative!", __func__); + dev_err(&port->dev, "%s outstanding tx bytes is negative!\n", + __func__); buffered = 0; } return buffered; @@ -1799,11 +1803,12 @@ static void ftdi_read_bulk_callback(struct urb *urb) int status = urb->status; if (urb->number_of_packets > 0) { - err("%s transfer_buffer_length %d actual_length %d number of packets %d", - __func__, - urb->transfer_buffer_length, - urb->actual_length, urb->number_of_packets); - err("%s transfer_flags %x ", __func__, urb->transfer_flags); + dev_err(&port->dev, "%s transfer_buffer_length %d " + "actual_length %d number of packets %d\n", __func__, + urb->transfer_buffer_length, + urb->actual_length, urb->number_of_packets); + dev_err(&port->dev, "%s transfer_flags %x\n", __func__, + urb->transfer_flags); } dbg("%s - port %d", __func__, port->number); @@ -1824,7 +1829,7 @@ static void ftdi_read_bulk_callback(struct urb *urb) } if (urb != port->read_urb) - err("%s - Not my urb!", __func__); + dev_err(&port->dev, "%s - Not my urb!\n", __func__); if (status) { /* This will happen at close every time so it is a dbg not an @@ -1927,7 +1932,8 @@ static void ftdi_process_read(struct work_struct *work) length = min(PKTSZ, urb->actual_length-packet_offset)-2; if (length < 0) { - err("%s - bad packet length: %d", __func__, length+2); + dev_err(&port->dev, "%s - bad packet length: %d\n", + __func__, length+2); length = 0; } @@ -2042,8 +2048,9 @@ static void ftdi_process_read(struct work_struct *work) 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); } out: tty_kref_put(tty); @@ -2072,8 +2079,8 @@ static void ftdi_break_ctl(struct tty_struct *tty, int break_state) FTDI_SIO_SET_DATA_REQUEST_TYPE, urb_value , priv->interface, buf, 0, WDR_TIMEOUT) < 0) { - err("%s FAILED to enable/disable break state (state was %d)", - __func__, break_state); + dev_err(&port->dev, "%s FAILED to enable/disable break state " + "(state was %d)\n", __func__, break_state); } dbg("%s break state is %d - urb is %d", __func__, @@ -2145,7 +2152,7 @@ static void ftdi_set_termios(struct tty_struct *tty, case CS7: urb_value |= 7; dbg("Setting CS7"); break; case CS8: urb_value |= 8; dbg("Setting CS8"); break; default: - err("CSIZE was set but not CS5-CS8"); + dev_err(&port->dev, "CSIZE was set but not CS5-CS8\n"); } } @@ -2158,7 +2165,8 @@ static void ftdi_set_termios(struct tty_struct *tty, FTDI_SIO_SET_DATA_REQUEST_TYPE, urb_value , priv->interface, buf, 0, WDR_SHORT_TIMEOUT) < 0) { - err("%s FAILED to set databits/stopbits/parity", __func__); + dev_err(&port->dev, "%s FAILED to set " + "databits/stopbits/parity\n", __func__); } /* Now do the baudrate */ @@ -2169,14 +2177,17 @@ static void ftdi_set_termios(struct tty_struct *tty, FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 0, priv->interface, buf, 0, WDR_TIMEOUT) < 0) { - err("%s error from disable flowcontrol urb", __func__); + dev_err(&port->dev, + "%s error from disable flowcontrol urb\n", + __func__); } /* Drop RTS and DTR */ clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); } else { /* set the baudrate determined before */ if (change_speed(tty, port)) - err("%s urb failed to set baudrate", __func__); + dev_err(&port->dev, "%s urb failed to set baudrate\n", + __func__); /* Ensure RTS and DTR are raised when baudrate changed from 0 */ if (!old_termios || (old_termios->c_cflag & CBAUD) == B0) set_mctrl(port, TIOCM_DTR | TIOCM_RTS); @@ -2192,7 +2203,8 @@ static void ftdi_set_termios(struct tty_struct *tty, FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 0 , (FTDI_SIO_RTS_CTS_HS | priv->interface), buf, 0, WDR_TIMEOUT) < 0) { - err("urb failed to set to rts/cts flow control"); + dev_err(&port->dev, + "urb failed to set to rts/cts flow control\n"); } } else { @@ -2223,7 +2235,8 @@ static void ftdi_set_termios(struct tty_struct *tty, urb_value , (FTDI_SIO_XON_XOFF_HS | priv->interface), buf, 0, WDR_TIMEOUT) < 0) { - err("urb failed to set to xon/xoff flow control"); + dev_err(&port->dev, "urb failed to set to " + "xon/xoff flow control\n"); } } else { /* else clause to only run if cflag ! CRTSCTS and iflag @@ -2236,7 +2249,8 @@ static void ftdi_set_termios(struct tty_struct *tty, FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, 0, priv->interface, buf, 0, WDR_TIMEOUT) < 0) { - err("urb failed to clear flow control"); + dev_err(&port->dev, + "urb failed to clear flow control\n"); } } diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index eb95efdfbe8..e85c8c0d1ad 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -3109,13 +3109,13 @@ static int edge_startup(struct usb_serial *serial) edge_serial->interrupt_read_urb = usb_alloc_urb(0, GFP_KERNEL); if (!edge_serial->interrupt_read_urb) { - err("out of memory"); + dev_err(&dev->dev, "out of memory\n"); return -ENOMEM; } edge_serial->interrupt_in_buffer = kmalloc(buffer_size, GFP_KERNEL); if (!edge_serial->interrupt_in_buffer) { - err("out of memory"); + dev_err(&dev->dev, "out of memory\n"); usb_free_urb(edge_serial->interrupt_read_urb); return -ENOMEM; } @@ -3146,13 +3146,13 @@ static int edge_startup(struct usb_serial *serial) edge_serial->read_urb = usb_alloc_urb(0, GFP_KERNEL); if (!edge_serial->read_urb) { - err("out of memory"); + dev_err(&dev->dev, "out of memory\n"); return -ENOMEM; } edge_serial->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); if (!edge_serial->bulk_in_buffer) { - err("out of memory"); + dev_err(&dev->dev, "out of memory\n"); usb_free_urb(edge_serial->read_urb); return -ENOMEM; } @@ -3181,7 +3181,8 @@ static int edge_startup(struct usb_serial *serial) } if (!interrupt_in_found || !bulk_in_found || !bulk_out_found) { - err("Error - the proper endpoints were not found!"); + dev_err(&dev->dev, "Error - the proper endpoints " + "were not found!\n"); return -ENODEV; } @@ -3190,8 +3191,9 @@ static int edge_startup(struct usb_serial *serial) response = usb_submit_urb(edge_serial->interrupt_read_urb, GFP_KERNEL); if (response) - err("%s - Error %d submitting control urb", - __func__, response); + dev_err(&dev->dev, + "%s - Error %d submitting control urb\n", + __func__, response); } return response; } diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index 5108cbc64a5..132be74d2b8 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c @@ -608,7 +608,7 @@ static int ipaq_open(struct tty_struct *tty, bytes_out = 0; priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); if (priv == NULL) { - err("%s - Out of memory", __func__); + dev_err(&port->dev, "%s - Out of memory\n", __func__); return -ENOMEM; } usb_set_serial_port_data(port, priv); @@ -693,8 +693,7 @@ static int ipaq_open(struct tty_struct *tty, } if (!retries && result) { - err("%s - failed doing control urb, error %d", __func__, - result); + dev_err(&port->dev, "%s - failed doing control urb, error %d\n", __func__, result); goto error; } @@ -707,8 +706,9 @@ static int ipaq_open(struct tty_struct *tty, result = usb_submit_urb(port->read_urb, GFP_KERNEL); if (result) { - err("%s - failed submitting read urb, error %d", - __func__, result); + dev_err(&port->dev, + "%s - failed submitting read urb, error %d\n", + __func__, result); goto error; } @@ -716,7 +716,7 @@ static int ipaq_open(struct tty_struct *tty, enomem: result = -ENOMEM; - err("%s - Out of memory", __func__); + dev_err(&port->dev, "%s - Out of memory\n", __func__); error: ipaq_destroy_lists(port); kfree(priv); @@ -781,8 +781,9 @@ static void ipaq_read_bulk_callback(struct urb *urb) ipaq_read_bulk_callback, port); 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); return; } @@ -847,7 +848,8 @@ static int ipaq_write_bulk(struct usb_serial_port *port, spin_unlock_irqrestore(&write_list_lock, flags); result = usb_submit_urb(port->write_urb, GFP_ATOMIC); if (result) - err("%s - failed submitting write urb, error %d", + dev_err(&port->dev, + "%s - failed submitting write urb, error %d\n", __func__, result); } else { spin_unlock_irqrestore(&write_list_lock, flags); @@ -909,8 +911,9 @@ static void ipaq_write_bulk_callback(struct urb *urb) spin_unlock_irqrestore(&write_list_lock, flags); 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); } else { priv->active = 0; spin_unlock_irqrestore(& |