Loading drivers/usb/serial/aircable.c +4 −4 Original line number Original line Diff line number Diff line Loading @@ -220,8 +220,8 @@ static void aircable_send(struct usb_serial_port *port) buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC); buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC); if (!buf) { if (!buf) { err("%s- kzalloc(%d) failed.", __func__, dev_err(&port->dev, "%s- kzalloc(%d) failed.\n", count + HCI_HEADER_LENGTH); __func__, count + HCI_HEADER_LENGTH); return; return; } } Loading Loading @@ -276,7 +276,7 @@ static void aircable_read(struct work_struct *work) if (!tty) { if (!tty) { schedule_work(&priv->rx_work); schedule_work(&priv->rx_work); err("%s - No tty available", __func__); dev_err(&port->dev, "%s - No tty available\n", __func__); return ; return ; } } Loading Loading @@ -336,7 +336,7 @@ static int aircable_attach(struct usb_serial *serial) priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL); priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL); if (!priv) { if (!priv) { err("%s- kmalloc(%Zd) failed.", __func__, dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__, sizeof(struct aircable_private)); sizeof(struct aircable_private)); return -ENOMEM; return -ENOMEM; } } Loading drivers/usb/serial/belkin_sa.c +17 −17 Original line number Original line Diff line number Diff line Loading @@ -228,7 +228,7 @@ static int belkin_sa_open(struct tty_struct *tty, port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev; retval = usb_submit_urb(port->read_urb, GFP_KERNEL); retval = usb_submit_urb(port->read_urb, GFP_KERNEL); if (retval) { if (retval) { err("usb_submit_urb(read bulk) failed"); dev_err(&port->dev, "usb_submit_urb(read bulk) failed\n"); goto exit; goto exit; } } Loading @@ -236,7 +236,7 @@ static int belkin_sa_open(struct tty_struct *tty, retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (retval) { if (retval) { usb_kill_urb(port->read_urb); 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: exit: Loading Loading @@ -342,8 +342,8 @@ static void belkin_sa_read_int_callback(struct urb *urb) exit: exit: retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC); if (retval) if (retval) err("%s - usb_submit_urb failed with result %d", dev_err(&port->dev, "%s - usb_submit_urb failed with " __func__, retval); "result %d\n", __func__, retval); } } static void belkin_sa_set_termios(struct tty_struct *tty, static void belkin_sa_set_termios(struct tty_struct *tty, Loading Loading @@ -382,12 +382,12 @@ static void belkin_sa_set_termios(struct tty_struct *tty, if ((old_cflag & CBAUD) == B0) { if ((old_cflag & CBAUD) == B0) { control_state |= (TIOCM_DTR|TIOCM_RTS); control_state |= (TIOCM_DTR|TIOCM_RTS); if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 1) < 0) 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 */ /* don't set RTS if using hardware flow control */ if (!(old_cflag & CRTSCTS)) if (!(old_cflag & CRTSCTS)) if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST , 1) < 0) , 1) < 0) err("Set RTS error"); dev_err(&port->dev, "Set RTS error\n"); } } } } Loading @@ -403,18 +403,18 @@ static void belkin_sa_set_termios(struct tty_struct *tty, /* Report the actual baud rate back to the caller */ /* Report the actual baud rate back to the caller */ tty_encode_baud_rate(tty, baud, baud); tty_encode_baud_rate(tty, baud, baud); if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, urb_value) < 0) 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 { } else { /* Disable flow control */ /* Disable flow control */ if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, BELKIN_SA_FLOW_NONE) < 0) BELKIN_SA_FLOW_NONE) < 0) err("Disable flowcontrol error"); dev_err(&port->dev, "Disable flowcontrol error\n"); /* Drop RTS and DTR */ /* Drop RTS and DTR */ control_state &= ~(TIOCM_DTR | TIOCM_RTS); control_state &= ~(TIOCM_DTR | TIOCM_RTS); if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0) 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) 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 */ /* set the parity */ Loading @@ -425,7 +425,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, else else urb_value = BELKIN_SA_PARITY_NONE; urb_value = BELKIN_SA_PARITY_NONE; if (BSA_USB_CMD(BELKIN_SA_SET_PARITY_REQUEST, urb_value) < 0) 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 */ /* set the number of data bits */ Loading @@ -448,7 +448,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, break; break; } } if (BSA_USB_CMD(BELKIN_SA_SET_DATA_BITS_REQUEST, urb_value) < 0) 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 */ /* set the number of stop bits */ Loading @@ -457,7 +457,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, : BELKIN_SA_STOP_BITS(1); : BELKIN_SA_STOP_BITS(1); if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST, if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST, urb_value) < 0) urb_value) < 0) err("Set stop bits error"); dev_err(&port->dev, "Set stop bits error\n"); } } /* Set flow control */ /* Set flow control */ Loading @@ -478,7 +478,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, urb_value &= ~(BELKIN_SA_FLOW_IRTS); urb_value &= ~(BELKIN_SA_FLOW_IRTS); if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, urb_value) < 0) 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 */ /* save off the modified port settings */ Loading @@ -494,7 +494,7 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state) struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial; if (BSA_USB_CMD(BELKIN_SA_SET_BREAK_REQUEST, break_state ? 1 : 0) < 0) 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); } } Loading Loading @@ -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); retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts); if (retval < 0) { if (retval < 0) { err("Set RTS error %d", retval); dev_err(&port->dev, "Set RTS error %d\n", retval); goto exit; goto exit; } } retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr); retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr); if (retval < 0) { if (retval < 0) { err("Set DTR error %d", retval); dev_err(&port->dev, "Set DTR error %d\n", retval); goto exit; goto exit; } } exit: exit: Loading drivers/usb/serial/cyberjack.c +14 −9 Original line number Original line Diff line number Diff line Loading @@ -141,7 +141,8 @@ static int cyberjack_startup(struct usb_serial *serial) result = usb_submit_urb(serial->port[i]->interrupt_in_urb, result = usb_submit_urb(serial->port[i]->interrupt_in_urb, GFP_KERNEL); GFP_KERNEL); if (result) 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__); dbg("%s - usb_submit_urb(int urb)", __func__); } } Loading Loading @@ -274,7 +275,8 @@ static int cyberjack_write(struct tty_struct *tty, /* send the data out the bulk port */ /* send the data out the bulk port */ result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC); if (result) { if (result) { err("%s - failed submitting write urb, error %d", dev_err(&port->dev, "%s - failed submitting write urb, error %d", __func__, result); __func__, result); /* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */ priv->wrfilled = 0; priv->wrfilled = 0; Loading Loading @@ -351,7 +353,9 @@ static void cyberjack_read_int_callback(struct urb *urb) port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC); if (result) 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__); dbg("%s - usb_submit_urb(read urb)", __func__); } } } } Loading @@ -360,7 +364,7 @@ static void cyberjack_read_int_callback(struct urb *urb) port->interrupt_in_urb->dev = port->serial->dev; port->interrupt_in_urb->dev = port->serial->dev; result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); if (result) 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__); dbg("%s - usb_submit_urb(int urb)", __func__); } } Loading Loading @@ -414,8 +418,8 @@ static void cyberjack_read_bulk_callback(struct urb *urb) port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC); if (result) if (result) err("%s - failed resubmitting read urb, error %d", dev_err(&port->dev, "%s - failed resubmitting read " __func__, result); "urb, error %d\n", __func__, result); dbg("%s - usb_submit_urb(read urb)", __func__); dbg("%s - usb_submit_urb(read urb)", __func__); } } } } Loading Loading @@ -462,7 +466,8 @@ static void cyberjack_write_bulk_callback(struct urb *urb) /* send the data out the bulk port */ /* send the data out the bulk port */ result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC); if (result) { if (result) { err("%s - failed submitting write urb, error %d", dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __func__, result); __func__, result); /* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */ priv->wrfilled = 0; priv->wrfilled = 0; Loading drivers/usb/serial/cypress_m8.c +10 −8 Original line number Original line Diff line number Diff line Loading @@ -404,8 +404,8 @@ static int cypress_serial_control(struct tty_struct *tty, retval != -ENODEV); retval != -ENODEV); if (retval != sizeof(feature_buffer)) { if (retval != sizeof(feature_buffer)) { err("%s - failed sending serial line settings - %d", dev_err(&port->dev, "%s - failed sending serial " __func__, retval); "line settings - %d\n", __func__, retval); cypress_set_dead(port); cypress_set_dead(port); } else { } else { spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags); Loading Loading @@ -443,7 +443,8 @@ static int cypress_serial_control(struct tty_struct *tty, && retval != -ENODEV); && retval != -ENODEV); if (retval != sizeof(feature_buffer)) { 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); cypress_set_dead(port); return retval; return retval; } else { } else { Loading Loading @@ -476,8 +477,8 @@ static void cypress_set_dead(struct usb_serial_port *port) priv->comm_is_ok = 0; priv->comm_is_ok = 0; spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags); err("cypress_m8 suspending failing port %d - interval might be too short", dev_err(&port->dev, "cypress_m8 suspending failing port %d - " port->number); "interval might be too short\n", port->number); } } Loading Loading @@ -679,7 +680,8 @@ static int cypress_open(struct tty_struct *tty, /* setup the port and start reading from the device */ /* setup the port and start reading from the device */ if (!port->interrupt_in_urb) { 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; return -1; } } Loading Loading @@ -1107,7 +1109,7 @@ static void cypress_set_termios(struct tty_struct *tty, data_bits = 3; data_bits = 3; break; break; default: default: err("%s - CSIZE was set, but not CS5-CS8", dev_err(&port->dev, "%s - CSIZE was set, but not CS5-CS8\n", __func__); __func__); data_bits = 3; data_bits = 3; } } Loading drivers/usb/serial/digi_acceleport.c +40 −25 Original line number Original line Diff line number Diff line Loading @@ -661,7 +661,8 @@ static int digi_write_oob_command(struct usb_serial_port *port, } } spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); if (ret) 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; return ret; } } Loading Loading @@ -743,7 +744,8 @@ static int digi_write_inb_command(struct usb_serial_port *port, spin_unlock_irqrestore(&priv->dp_port_lock, flags); spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret) 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); __func__, ret, priv->dp_port_num); return ret; return ret; } } Loading Loading @@ -812,7 +814,8 @@ static int digi_set_modem_signals(struct usb_serial_port *port, spin_unlock(&port_priv->dp_port_lock); spin_unlock(&port_priv->dp_port_lock); spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); if (ret) 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; return ret; } } Loading Loading @@ -907,7 +910,8 @@ static void digi_rx_unthrottle(struct tty_struct *tty) spin_unlock_irqrestore(&priv->dp_port_lock, flags); spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret) 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); __func__, ret, priv->dp_port_num); } } Loading Loading @@ -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 */ /* return length of new data written, or error */ spin_unlock_irqrestore(&priv->dp_port_lock, flags); spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret < 0) 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); __func__, ret, priv->dp_port_num); dbg("digi_write: returning %d", ret); dbg("digi_write: returning %d", ret); return ret; return ret; Loading @@ -1235,13 +1240,15 @@ static void digi_write_bulk_callback(struct urb *urb) /* port and serial sanity check */ /* port and serial sanity check */ if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { err("%s: port or port->private is NULL, status=%d", dev_err(&port->dev, "%s: port or port->private is NULL, status=%d\n", __func__, status); __func__, status); return; return; } } serial = port->serial; serial = port->serial; if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) { if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) { err("%s: serial or serial->private is NULL, status=%d", dev_err(&port->dev, "%s: serial or serial->private is NULL, status=%d\n", __func__, status); __func__, status); return; return; } } Loading Loading @@ -1284,7 +1291,8 @@ static void digi_write_bulk_callback(struct urb *urb) spin_unlock(&priv->dp_port_lock); spin_unlock(&priv->dp_port_lock); if (ret) 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); __func__, ret, priv->dp_port_num); } } Loading Loading @@ -1518,7 +1526,8 @@ static int digi_startup_device(struct usb_serial *serial) port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev; ret = usb_submit_urb(port->read_urb, GFP_KERNEL); ret = usb_submit_urb(port->read_urb, GFP_KERNEL); if (ret != 0) { 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, i); __func__, ret, i); break; break; } } Loading Loading @@ -1618,21 +1627,25 @@ static void digi_read_bulk_callback(struct urb *urb) dbg("digi_read_bulk_callback: TOP"); dbg("digi_read_bulk_callback: TOP"); /* port sanity check, do not resubmit if port is not valid */ /* port sanity check, do not resubmit if port is not valid */ if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { if (port == NULL) err("%s: port or port->private is NULL, status=%d", 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); __func__, status); return; return; } } if (port->serial == NULL || if (port->serial == NULL || (serial_priv = usb_get_serial_data(port->serial)) == NULL) { (serial_priv = usb_get_serial_data(port->serial)) == NULL) { err("%s: serial is bad or serial->private is NULL, status=%d", dev_err(&port->dev, "%s: serial is bad or serial->private " __func__, status); "is NULL, status=%d\n", __func__, status); return; return; } } /* do not resubmit urb if it has any status error */ /* do not resubmit urb if it has any status error */ if (status) { if (status) { err("%s: nonzero read bulk status: status=%d, port=%d", dev_err(&port->dev, "%s: nonzero read bulk status: status=%d, port=%d\n", __func__, status, priv->dp_port_num); __func__, status, priv->dp_port_num); return; return; } } Loading @@ -1650,7 +1663,8 @@ static void digi_read_bulk_callback(struct urb *urb) urb->dev = port->serial->dev; urb->dev = port->serial->dev; ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC); if (ret != 0) { if (ret != 0) { err("%s: failed resubmitting urb, ret=%d, port=%d", dev_err(&port->dev, "%s: failed resubmitting urb, ret=%d, port=%d\n", __func__, ret, priv->dp_port_num); __func__, ret, priv->dp_port_num); } } Loading Loading @@ -1687,10 +1701,11 @@ static int digi_read_inb_callback(struct urb *urb) /* short/multiple packet check */ /* short/multiple packet check */ if (urb->actual_length != len + 2) { if (urb->actual_length != len + 2) { err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, " dev_err(&port->dev, "%s: INCOMPLETE OR MULTIPLE PACKET, " "port=%d, opcode=%d, len=%d, actual_length=%d, " "urb->status=%d, port=%d, opcode=%d, len=%d, " "status=%d", __func__, status, priv->dp_port_num, "actual_length=%d, status=%d\n", __func__, status, opcode, len, urb->actual_length, port_status); priv->dp_port_num, opcode, len, urb->actual_length, port_status); return -1; return -1; } } Loading Loading
drivers/usb/serial/aircable.c +4 −4 Original line number Original line Diff line number Diff line Loading @@ -220,8 +220,8 @@ static void aircable_send(struct usb_serial_port *port) buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC); buf = kzalloc(count + HCI_HEADER_LENGTH, GFP_ATOMIC); if (!buf) { if (!buf) { err("%s- kzalloc(%d) failed.", __func__, dev_err(&port->dev, "%s- kzalloc(%d) failed.\n", count + HCI_HEADER_LENGTH); __func__, count + HCI_HEADER_LENGTH); return; return; } } Loading Loading @@ -276,7 +276,7 @@ static void aircable_read(struct work_struct *work) if (!tty) { if (!tty) { schedule_work(&priv->rx_work); schedule_work(&priv->rx_work); err("%s - No tty available", __func__); dev_err(&port->dev, "%s - No tty available\n", __func__); return ; return ; } } Loading Loading @@ -336,7 +336,7 @@ static int aircable_attach(struct usb_serial *serial) priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL); priv = kzalloc(sizeof(struct aircable_private), GFP_KERNEL); if (!priv) { if (!priv) { err("%s- kmalloc(%Zd) failed.", __func__, dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__, sizeof(struct aircable_private)); sizeof(struct aircable_private)); return -ENOMEM; return -ENOMEM; } } Loading
drivers/usb/serial/belkin_sa.c +17 −17 Original line number Original line Diff line number Diff line Loading @@ -228,7 +228,7 @@ static int belkin_sa_open(struct tty_struct *tty, port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev; retval = usb_submit_urb(port->read_urb, GFP_KERNEL); retval = usb_submit_urb(port->read_urb, GFP_KERNEL); if (retval) { if (retval) { err("usb_submit_urb(read bulk) failed"); dev_err(&port->dev, "usb_submit_urb(read bulk) failed\n"); goto exit; goto exit; } } Loading @@ -236,7 +236,7 @@ static int belkin_sa_open(struct tty_struct *tty, retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL); if (retval) { if (retval) { usb_kill_urb(port->read_urb); 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: exit: Loading Loading @@ -342,8 +342,8 @@ static void belkin_sa_read_int_callback(struct urb *urb) exit: exit: retval = usb_submit_urb(urb, GFP_ATOMIC); retval = usb_submit_urb(urb, GFP_ATOMIC); if (retval) if (retval) err("%s - usb_submit_urb failed with result %d", dev_err(&port->dev, "%s - usb_submit_urb failed with " __func__, retval); "result %d\n", __func__, retval); } } static void belkin_sa_set_termios(struct tty_struct *tty, static void belkin_sa_set_termios(struct tty_struct *tty, Loading Loading @@ -382,12 +382,12 @@ static void belkin_sa_set_termios(struct tty_struct *tty, if ((old_cflag & CBAUD) == B0) { if ((old_cflag & CBAUD) == B0) { control_state |= (TIOCM_DTR|TIOCM_RTS); control_state |= (TIOCM_DTR|TIOCM_RTS); if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 1) < 0) 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 */ /* don't set RTS if using hardware flow control */ if (!(old_cflag & CRTSCTS)) if (!(old_cflag & CRTSCTS)) if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST , 1) < 0) , 1) < 0) err("Set RTS error"); dev_err(&port->dev, "Set RTS error\n"); } } } } Loading @@ -403,18 +403,18 @@ static void belkin_sa_set_termios(struct tty_struct *tty, /* Report the actual baud rate back to the caller */ /* Report the actual baud rate back to the caller */ tty_encode_baud_rate(tty, baud, baud); tty_encode_baud_rate(tty, baud, baud); if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, urb_value) < 0) 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 { } else { /* Disable flow control */ /* Disable flow control */ if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, BELKIN_SA_FLOW_NONE) < 0) BELKIN_SA_FLOW_NONE) < 0) err("Disable flowcontrol error"); dev_err(&port->dev, "Disable flowcontrol error\n"); /* Drop RTS and DTR */ /* Drop RTS and DTR */ control_state &= ~(TIOCM_DTR | TIOCM_RTS); control_state &= ~(TIOCM_DTR | TIOCM_RTS); if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0) 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) 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 */ /* set the parity */ Loading @@ -425,7 +425,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, else else urb_value = BELKIN_SA_PARITY_NONE; urb_value = BELKIN_SA_PARITY_NONE; if (BSA_USB_CMD(BELKIN_SA_SET_PARITY_REQUEST, urb_value) < 0) 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 */ /* set the number of data bits */ Loading @@ -448,7 +448,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, break; break; } } if (BSA_USB_CMD(BELKIN_SA_SET_DATA_BITS_REQUEST, urb_value) < 0) 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 */ /* set the number of stop bits */ Loading @@ -457,7 +457,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, : BELKIN_SA_STOP_BITS(1); : BELKIN_SA_STOP_BITS(1); if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST, if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST, urb_value) < 0) urb_value) < 0) err("Set stop bits error"); dev_err(&port->dev, "Set stop bits error\n"); } } /* Set flow control */ /* Set flow control */ Loading @@ -478,7 +478,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, urb_value &= ~(BELKIN_SA_FLOW_IRTS); urb_value &= ~(BELKIN_SA_FLOW_IRTS); if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, urb_value) < 0) 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 */ /* save off the modified port settings */ Loading @@ -494,7 +494,7 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state) struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial; if (BSA_USB_CMD(BELKIN_SA_SET_BREAK_REQUEST, break_state ? 1 : 0) < 0) 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); } } Loading Loading @@ -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); retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts); if (retval < 0) { if (retval < 0) { err("Set RTS error %d", retval); dev_err(&port->dev, "Set RTS error %d\n", retval); goto exit; goto exit; } } retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr); retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr); if (retval < 0) { if (retval < 0) { err("Set DTR error %d", retval); dev_err(&port->dev, "Set DTR error %d\n", retval); goto exit; goto exit; } } exit: exit: Loading
drivers/usb/serial/cyberjack.c +14 −9 Original line number Original line Diff line number Diff line Loading @@ -141,7 +141,8 @@ static int cyberjack_startup(struct usb_serial *serial) result = usb_submit_urb(serial->port[i]->interrupt_in_urb, result = usb_submit_urb(serial->port[i]->interrupt_in_urb, GFP_KERNEL); GFP_KERNEL); if (result) 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__); dbg("%s - usb_submit_urb(int urb)", __func__); } } Loading Loading @@ -274,7 +275,8 @@ static int cyberjack_write(struct tty_struct *tty, /* send the data out the bulk port */ /* send the data out the bulk port */ result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC); if (result) { if (result) { err("%s - failed submitting write urb, error %d", dev_err(&port->dev, "%s - failed submitting write urb, error %d", __func__, result); __func__, result); /* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */ priv->wrfilled = 0; priv->wrfilled = 0; Loading Loading @@ -351,7 +353,9 @@ static void cyberjack_read_int_callback(struct urb *urb) port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC); if (result) 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__); dbg("%s - usb_submit_urb(read urb)", __func__); } } } } Loading @@ -360,7 +364,7 @@ static void cyberjack_read_int_callback(struct urb *urb) port->interrupt_in_urb->dev = port->serial->dev; port->interrupt_in_urb->dev = port->serial->dev; result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); if (result) 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__); dbg("%s - usb_submit_urb(int urb)", __func__); } } Loading Loading @@ -414,8 +418,8 @@ static void cyberjack_read_bulk_callback(struct urb *urb) port->read_urb->dev = port->serial->dev; port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb, GFP_ATOMIC); result = usb_submit_urb(port->read_urb, GFP_ATOMIC); if (result) if (result) err("%s - failed resubmitting read urb, error %d", dev_err(&port->dev, "%s - failed resubmitting read " __func__, result); "urb, error %d\n", __func__, result); dbg("%s - usb_submit_urb(read urb)", __func__); dbg("%s - usb_submit_urb(read urb)", __func__); } } } } Loading Loading @@ -462,7 +466,8 @@ static void cyberjack_write_bulk_callback(struct urb *urb) /* send the data out the bulk port */ /* send the data out the bulk port */ result = usb_submit_urb(port->write_urb, GFP_ATOMIC); result = usb_submit_urb(port->write_urb, GFP_ATOMIC); if (result) { if (result) { err("%s - failed submitting write urb, error %d", dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __func__, result); __func__, result); /* Throw away data. No better idea what to do with it. */ /* Throw away data. No better idea what to do with it. */ priv->wrfilled = 0; priv->wrfilled = 0; Loading
drivers/usb/serial/cypress_m8.c +10 −8 Original line number Original line Diff line number Diff line Loading @@ -404,8 +404,8 @@ static int cypress_serial_control(struct tty_struct *tty, retval != -ENODEV); retval != -ENODEV); if (retval != sizeof(feature_buffer)) { if (retval != sizeof(feature_buffer)) { err("%s - failed sending serial line settings - %d", dev_err(&port->dev, "%s - failed sending serial " __func__, retval); "line settings - %d\n", __func__, retval); cypress_set_dead(port); cypress_set_dead(port); } else { } else { spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags); Loading Loading @@ -443,7 +443,8 @@ static int cypress_serial_control(struct tty_struct *tty, && retval != -ENODEV); && retval != -ENODEV); if (retval != sizeof(feature_buffer)) { 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); cypress_set_dead(port); return retval; return retval; } else { } else { Loading Loading @@ -476,8 +477,8 @@ static void cypress_set_dead(struct usb_serial_port *port) priv->comm_is_ok = 0; priv->comm_is_ok = 0; spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags); err("cypress_m8 suspending failing port %d - interval might be too short", dev_err(&port->dev, "cypress_m8 suspending failing port %d - " port->number); "interval might be too short\n", port->number); } } Loading Loading @@ -679,7 +680,8 @@ static int cypress_open(struct tty_struct *tty, /* setup the port and start reading from the device */ /* setup the port and start reading from the device */ if (!port->interrupt_in_urb) { 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; return -1; } } Loading Loading @@ -1107,7 +1109,7 @@ static void cypress_set_termios(struct tty_struct *tty, data_bits = 3; data_bits = 3; break; break; default: default: err("%s - CSIZE was set, but not CS5-CS8", dev_err(&port->dev, "%s - CSIZE was set, but not CS5-CS8\n", __func__); __func__); data_bits = 3; data_bits = 3; } } Loading
drivers/usb/serial/digi_acceleport.c +40 −25 Original line number Original line Diff line number Diff line Loading @@ -661,7 +661,8 @@ static int digi_write_oob_command(struct usb_serial_port *port, } } spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); if (ret) 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; return ret; } } Loading Loading @@ -743,7 +744,8 @@ static int digi_write_inb_command(struct usb_serial_port *port, spin_unlock_irqrestore(&priv->dp_port_lock, flags); spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret) 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); __func__, ret, priv->dp_port_num); return ret; return ret; } } Loading Loading @@ -812,7 +814,8 @@ static int digi_set_modem_signals(struct usb_serial_port *port, spin_unlock(&port_priv->dp_port_lock); spin_unlock(&port_priv->dp_port_lock); spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); if (ret) 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; return ret; } } Loading Loading @@ -907,7 +910,8 @@ static void digi_rx_unthrottle(struct tty_struct *tty) spin_unlock_irqrestore(&priv->dp_port_lock, flags); spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret) 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); __func__, ret, priv->dp_port_num); } } Loading Loading @@ -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 */ /* return length of new data written, or error */ spin_unlock_irqrestore(&priv->dp_port_lock, flags); spin_unlock_irqrestore(&priv->dp_port_lock, flags); if (ret < 0) 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); __func__, ret, priv->dp_port_num); dbg("digi_write: returning %d", ret); dbg("digi_write: returning %d", ret); return ret; return ret; Loading @@ -1235,13 +1240,15 @@ static void digi_write_bulk_callback(struct urb *urb) /* port and serial sanity check */ /* port and serial sanity check */ if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { err("%s: port or port->private is NULL, status=%d", dev_err(&port->dev, "%s: port or port->private is NULL, status=%d\n", __func__, status); __func__, status); return; return; } } serial = port->serial; serial = port->serial; if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) { if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) { err("%s: serial or serial->private is NULL, status=%d", dev_err(&port->dev, "%s: serial or serial->private is NULL, status=%d\n", __func__, status); __func__, status); return; return; } } Loading Loading @@ -1284,7 +1291,8 @@ static void digi_write_bulk_callback(struct urb *urb) spin_unlock(&priv->dp_port_lock); spin_unlock(&priv->dp_port_lock); if (ret) 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); __func__, ret, priv->dp_port_num); } } Loading Loading @@ -1518,7 +1526,8 @@ static int digi_startup_device(struct usb_serial *serial) port->write_urb->dev = port->serial->dev; port->write_urb->dev = port->serial->dev; ret = usb_submit_urb(port->read_urb, GFP_KERNEL); ret = usb_submit_urb(port->read_urb, GFP_KERNEL); if (ret != 0) { 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, i); __func__, ret, i); break; break; } } Loading Loading @@ -1618,21 +1627,25 @@ static void digi_read_bulk_callback(struct urb *urb) dbg("digi_read_bulk_callback: TOP"); dbg("digi_read_bulk_callback: TOP"); /* port sanity check, do not resubmit if port is not valid */ /* port sanity check, do not resubmit if port is not valid */ if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { if (port == NULL) err("%s: port or port->private is NULL, status=%d", 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); __func__, status); return; return; } } if (port->serial == NULL || if (port->serial == NULL || (serial_priv = usb_get_serial_data(port->serial)) == NULL) { (serial_priv = usb_get_serial_data(port->serial)) == NULL) { err("%s: serial is bad or serial->private is NULL, status=%d", dev_err(&port->dev, "%s: serial is bad or serial->private " __func__, status); "is NULL, status=%d\n", __func__, status); return; return; } } /* do not resubmit urb if it has any status error */ /* do not resubmit urb if it has any status error */ if (status) { if (status) { err("%s: nonzero read bulk status: status=%d, port=%d", dev_err(&port->dev, "%s: nonzero read bulk status: status=%d, port=%d\n", __func__, status, priv->dp_port_num); __func__, status, priv->dp_port_num); return; return; } } Loading @@ -1650,7 +1663,8 @@ static void digi_read_bulk_callback(struct urb *urb) urb->dev = port->serial->dev; urb->dev = port->serial->dev; ret = usb_submit_urb(urb, GFP_ATOMIC); ret = usb_submit_urb(urb, GFP_ATOMIC); if (ret != 0) { if (ret != 0) { err("%s: failed resubmitting urb, ret=%d, port=%d", dev_err(&port->dev, "%s: failed resubmitting urb, ret=%d, port=%d\n", __func__, ret, priv->dp_port_num); __func__, ret, priv->dp_port_num); } } Loading Loading @@ -1687,10 +1701,11 @@ static int digi_read_inb_callback(struct urb *urb) /* short/multiple packet check */ /* short/multiple packet check */ if (urb->actual_length != len + 2) { if (urb->actual_length != len + 2) { err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, " dev_err(&port->dev, "%s: INCOMPLETE OR MULTIPLE PACKET, " "port=%d, opcode=%d, len=%d, actual_length=%d, " "urb->status=%d, port=%d, opcode=%d, len=%d, " "status=%d", __func__, status, priv->dp_port_num, "actual_length=%d, status=%d\n", __func__, status, opcode, len, urb->actual_length, port_status); priv->dp_port_num, opcode, len, urb->actual_length, port_status); return -1; return -1; } } Loading