aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-q.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/uhci-q.c')
-rw-r--r--drivers/usb/host/uhci-q.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/host/uhci-q.c b/drivers/usb/host/uhci-q.c
index bab567266559..e5d60d5b105a 100644
--- a/drivers/usb/host/uhci-q.c
+++ b/drivers/usb/host/uhci-q.c
@@ -1480,7 +1480,7 @@ done:
1480 * Finish unlinking an URB and give it back 1480 * Finish unlinking an URB and give it back
1481 */ 1481 */
1482static void uhci_giveback_urb(struct uhci_hcd *uhci, struct uhci_qh *qh, 1482static void uhci_giveback_urb(struct uhci_hcd *uhci, struct uhci_qh *qh,
1483 struct urb *urb) 1483 struct urb *urb, int status)
1484__releases(uhci->lock) 1484__releases(uhci->lock)
1485__acquires(uhci->lock) 1485__acquires(uhci->lock)
1486{ 1486{
@@ -1520,7 +1520,7 @@ __acquires(uhci->lock)
1520 usb_hcd_unlink_urb_from_ep(uhci_to_hcd(uhci), urb); 1520 usb_hcd_unlink_urb_from_ep(uhci_to_hcd(uhci), urb);
1521 1521
1522 spin_unlock(&uhci->lock); 1522 spin_unlock(&uhci->lock);
1523 usb_hcd_giveback_urb(uhci_to_hcd(uhci), urb); 1523 usb_hcd_giveback_urb(uhci_to_hcd(uhci), urb, status);
1524 spin_lock(&uhci->lock); 1524 spin_lock(&uhci->lock);
1525 1525
1526 /* If the queue is now empty, we can unlink the QH and give up its 1526 /* If the queue is now empty, we can unlink the QH and give up its
@@ -1556,10 +1556,6 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
1556 if (status == -EINPROGRESS) 1556 if (status == -EINPROGRESS)
1557 break; 1557 break;
1558 1558
1559 spin_lock(&urb->lock);
1560 urb->status = status;
1561 spin_unlock(&urb->lock);
1562
1563 /* Dequeued but completed URBs can't be given back unless 1559 /* Dequeued but completed URBs can't be given back unless
1564 * the QH is stopped or has finished unlinking. */ 1560 * the QH is stopped or has finished unlinking. */
1565 if (urb->unlinked) { 1561 if (urb->unlinked) {
@@ -1569,7 +1565,7 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
1569 return; 1565 return;
1570 } 1566 }
1571 1567
1572 uhci_giveback_urb(uhci, qh, urb); 1568 uhci_giveback_urb(uhci, qh, urb, status);
1573 if (status < 0) 1569 if (status < 0)
1574 break; 1570 break;
1575 } 1571 }
@@ -1594,7 +1590,7 @@ restart:
1594 qh->is_stopped = 0; 1590 qh->is_stopped = 0;
1595 return; 1591 return;
1596 } 1592 }
1597 uhci_giveback_urb(uhci, qh, urb); 1593 uhci_giveback_urb(uhci, qh, urb, 0);
1598 goto restart; 1594 goto restart;
1599 } 1595 }
1600 } 1596 }