aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/digi_acceleport.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/serial/digi_acceleport.c')
-rw-r--r--drivers/usb/serial/digi_acceleport.c65
1 files changed, 40 insertions, 25 deletions
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c
index ebc2918719a0..69f84f0ea6fe 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,
661 } 661 }
662 spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); 662 spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
663 if (ret) 663 if (ret)
664 err("%s: usb_submit_urb failed, ret=%d", __func__, ret); 664 dev_err(&port->dev, "%s: usb_submit_urb failed, ret=%d\n",
665 __func__, ret);
665 return ret; 666 return ret;
666 667
667} 668}
@@ -743,7 +744,8 @@ static int digi_write_inb_command(struct usb_serial_port *port,
743 spin_unlock_irqrestore(&priv->dp_port_lock, flags); 744 spin_unlock_irqrestore(&priv->dp_port_lock, flags);
744 745
745 if (ret) 746 if (ret)
746 err("%s: usb_submit_urb failed, ret=%d, port=%d", 747 dev_err(&port->dev,
748 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
747 __func__, ret, priv->dp_port_num); 749 __func__, ret, priv->dp_port_num);
748 return ret; 750 return ret;
749} 751}
@@ -812,7 +814,8 @@ static int digi_set_modem_signals(struct usb_serial_port *port,
812 spin_unlock(&port_priv->dp_port_lock); 814 spin_unlock(&port_priv->dp_port_lock);
813 spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags); 815 spin_unlock_irqrestore(&oob_priv->dp_port_lock, flags);
814 if (ret) 816 if (ret)
815 err("%s: usb_submit_urb failed, ret=%d", __func__, ret); 817 dev_err(&port->dev, "%s: usb_submit_urb failed, ret=%d\n",
818 __func__, ret);
816 return ret; 819 return ret;
817} 820}
818 821
@@ -907,7 +910,8 @@ static void digi_rx_unthrottle(struct tty_struct *tty)
907 spin_unlock_irqrestore(&priv->dp_port_lock, flags); 910 spin_unlock_irqrestore(&priv->dp_port_lock, flags);
908 911
909 if (ret) 912 if (ret)
910 err("%s: usb_submit_urb failed, ret=%d, port=%d", 913 dev_err(&port->dev,
914 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
911 __func__, ret, priv->dp_port_num); 915 __func__, ret, priv->dp_port_num);
912} 916}
913 917
@@ -1214,7 +1218,8 @@ static int digi_write(struct tty_struct *tty, struct usb_serial_port *port,
1214 /* return length of new data written, or error */ 1218 /* return length of new data written, or error */
1215 spin_unlock_irqrestore(&priv->dp_port_lock, flags); 1219 spin_unlock_irqrestore(&priv->dp_port_lock, flags);
1216 if (ret < 0) 1220 if (ret < 0)
1217 err("%s: usb_submit_urb failed, ret=%d, port=%d", 1221 dev_err(&port->dev,
1222 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
1218 __func__, ret, priv->dp_port_num); 1223 __func__, ret, priv->dp_port_num);
1219 dbg("digi_write: returning %d", ret); 1224 dbg("digi_write: returning %d", ret);
1220 return ret; 1225 return ret;
@@ -1235,14 +1240,16 @@ static void digi_write_bulk_callback(struct urb *urb)
1235 1240
1236 /* port and serial sanity check */ 1241 /* port and serial sanity check */
1237 if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { 1242 if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) {
1238 err("%s: port or port->private is NULL, status=%d", 1243 dev_err(&port->dev,
1239 __func__, status); 1244 "%s: port or port->private is NULL, status=%d\n",
1245 __func__, status);
1240 return; 1246 return;
1241 } 1247 }
1242 serial = port->serial; 1248 serial = port->serial;
1243 if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) { 1249 if (serial == NULL || (serial_priv = usb_get_serial_data(serial)) == NULL) {
1244 err("%s: serial or serial->private is NULL, status=%d", 1250 dev_err(&port->dev,
1245 __func__, status); 1251 "%s: serial or serial->private is NULL, status=%d\n",
1252 __func__, status);
1246 return; 1253 return;
1247 } 1254 }
1248 1255
@@ -1284,7 +1291,8 @@ static void digi_write_bulk_callback(struct urb *urb)
1284 1291
1285 spin_unlock(&priv->dp_port_lock); 1292 spin_unlock(&priv->dp_port_lock);
1286 if (ret) 1293 if (ret)
1287 err("%s: usb_submit_urb failed, ret=%d, port=%d", 1294 dev_err(&port->dev,
1295 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
1288 __func__, ret, priv->dp_port_num); 1296 __func__, ret, priv->dp_port_num);
1289} 1297}
1290 1298
@@ -1518,8 +1526,9 @@ static int digi_startup_device(struct usb_serial *serial)
1518 port->write_urb->dev = port->serial->dev; 1526 port->write_urb->dev = port->serial->dev;
1519 ret = usb_submit_urb(port->read_urb, GFP_KERNEL); 1527 ret = usb_submit_urb(port->read_urb, GFP_KERNEL);
1520 if (ret != 0) { 1528 if (ret != 0) {
1521 err("%s: usb_submit_urb failed, ret=%d, port=%d", 1529 dev_err(&port->dev,
1522 __func__, ret, i); 1530 "%s: usb_submit_urb failed, ret=%d, port=%d\n",
1531 __func__, ret, i);
1523 break; 1532 break;
1524 } 1533 }
1525 } 1534 }
@@ -1618,22 +1627,26 @@ static void digi_read_bulk_callback(struct urb *urb)
1618 dbg("digi_read_bulk_callback: TOP"); 1627 dbg("digi_read_bulk_callback: TOP");
1619 1628
1620 /* port sanity check, do not resubmit if port is not valid */ 1629 /* port sanity check, do not resubmit if port is not valid */
1621 if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { 1630 if (port == NULL)
1622 err("%s: port or port->private is NULL, status=%d", 1631 return;
1623 __func__, status); 1632 priv = usb_get_serial_port_data(port);
1633 if (priv == NULL) {
1634 dev_err(&port->dev, "%s: port->private is NULL, status=%d\n",
1635 __func__, status);
1624 return; 1636 return;
1625 } 1637 }
1626 if (port->serial == NULL || 1638 if (port->serial == NULL ||
1627 (serial_priv = usb_get_serial_data(port->serial)) == NULL) { 1639 (serial_priv = usb_get_serial_data(port->serial)) == NULL) {
1628 err("%s: serial is bad or serial->private is NULL, status=%d", 1640 dev_err(&port->dev, "%s: serial is bad or serial->private "
1629 __func__, status); 1641 "is NULL, status=%d\n", __func__, status);
1630 return; 1642 return;
1631 } 1643 }
1632 1644
1633 /* do not resubmit urb if it has any status error */ 1645 /* do not resubmit urb if it has any status error */
1634 if (status) { 1646 if (status) {
1635 err("%s: nonzero read bulk status: status=%d, port=%d", 1647 dev_err(&port->dev,
1636 __func__, status, priv->dp_port_num); 1648 "%s: nonzero read bulk status: status=%d, port=%d\n",
1649 __func__, status, priv->dp_port_num);
1637 return; 1650 return;
1638 } 1651 }
1639 1652
@@ -1650,8 +1663,9 @@ static void digi_read_bulk_callback(struct urb *urb)
1650 urb->dev = port->serial->dev; 1663 urb->dev = port->serial->dev;
1651 ret = usb_submit_urb(urb, GFP_ATOMIC); 1664 ret = usb_submit_urb(urb, GFP_ATOMIC);
1652 if (ret != 0) { 1665 if (ret != 0) {
1653 err("%s: failed resubmitting urb, ret=%d, port=%d", 1666 dev_err(&port->dev,
1654 __func__, ret, priv->dp_port_num); 1667 "%s: failed resubmitting urb, ret=%d, port=%d\n",
1668 __func__, ret, priv->dp_port_num);
1655 } 1669 }
1656 1670
1657} 1671}
@@ -1687,10 +1701,11 @@ static int digi_read_inb_callback(struct urb *urb)
1687 1701
1688 /* short/multiple packet check */ 1702 /* short/multiple packet check */
1689 if (urb->actual_length != len + 2) { 1703 if (urb->actual_length != len + 2) {
1690 err("%s: INCOMPLETE OR MULTIPLE PACKET, urb->status=%d, " 1704 dev_err(&port->dev, "%s: INCOMPLETE OR MULTIPLE PACKET, "
1691 "port=%d, opcode=%d, len=%d, actual_length=%d, " 1705 "urb->status=%d, port=%d, opcode=%d, len=%d, "
1692 "status=%d", __func__, status, priv->dp_port_num, 1706 "actual_length=%d, status=%d\n", __func__, status,
1693 opcode, len, urb->actual_length, port_status); 1707 priv->dp_port_num, opcode, len, urb->actual_length,
1708 port_status);
1694 return -1; 1709 return -1;
1695 } 1710 }
1696 1711