aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/uhci-q.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-08-24 15:42:24 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:23 -0400
commit4a00027dcb088bf90fa8fb14a7e8ba3506d78f22 (patch)
tree992b3dbda7b950b8906ac4751e43a28fd15e2e5d /drivers/usb/host/uhci-q.c
parent9347d51c52afcf1a77d2104f162cf8a085624c83 (diff)
USB: Eliminate urb->status usage!
This patch (as979) removes the last vestiges of urb->status from the host controller drivers and the root-hub emulator. Now the field doesn't get set until just before the URB's completion routine is called. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> CC: Olav Kongas <ok@artecdesign.ee> CC: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> CC: Tony Olech <tony.olech@elandigitalsystems.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 }