Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
[deliverable/linux.git] / drivers / usb / host / uhci-q.c
index 793a04685ef4983d02d586f584e6e96a03e2be90..e5d60d5b105a8975979c731a401eee26b0effd62 100644 (file)
@@ -757,7 +757,6 @@ static void uhci_free_urb_priv(struct uhci_hcd *uhci,
                uhci_free_td(uhci, td);
        }
 
-       urbp->urb->hcpriv = NULL;
        kmem_cache_free(uhci_up_cachep, urbp);
 }
 
@@ -1481,7 +1480,7 @@ done:
  * Finish unlinking an URB and give it back
  */
 static void uhci_giveback_urb(struct uhci_hcd *uhci, struct uhci_qh *qh,
-               struct urb *urb)
+               struct urb *urb, int status)
 __releases(uhci->lock)
 __acquires(uhci->lock)
 {
@@ -1494,13 +1493,6 @@ __acquires(uhci->lock)
                 * unlinked first.  Regardless, don't confuse people with a
                 * negative length. */
                urb->actual_length = max(urb->actual_length, 0);
-
-               /* Report erroneous short transfers */
-               if (unlikely((urb->transfer_flags & URB_SHORT_NOT_OK) &&
-                               urb->actual_length <
-                                       urb->transfer_buffer_length &&
-                               urb->status == 0))
-                       urb->status = -EREMOTEIO;
        }
 
        /* When giving back the first URB in an Isochronous queue,
@@ -1528,7 +1520,7 @@ __acquires(uhci->lock)
        usb_hcd_unlink_urb_from_ep(uhci_to_hcd(uhci), urb);
 
        spin_unlock(&uhci->lock);
-       usb_hcd_giveback_urb(uhci_to_hcd(uhci), urb);
+       usb_hcd_giveback_urb(uhci_to_hcd(uhci), urb, status);
        spin_lock(&uhci->lock);
 
        /* If the queue is now empty, we can unlink the QH and give up its
@@ -1564,23 +1556,16 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
                if (status == -EINPROGRESS)
                        break;
 
-               spin_lock(&urb->lock);
-               if (urb->status == -EINPROGRESS)        /* Not dequeued */
-                       urb->status = status;
-               else
-                       status = ECONNRESET;            /* Not -ECONNRESET */
-               spin_unlock(&urb->lock);
-
                /* Dequeued but completed URBs can't be given back unless
                 * the QH is stopped or has finished unlinking. */
-               if (status == ECONNRESET) {
+               if (urb->unlinked) {
                        if (QH_FINISHED_UNLINKING(qh))
                                qh->is_stopped = 1;
                        else if (!qh->is_stopped)
                                return;
                }
 
-               uhci_giveback_urb(uhci, qh, urb);
+               uhci_giveback_urb(uhci, qh, urb, status);
                if (status < 0)
                        break;
        }
@@ -1596,7 +1581,7 @@ static void uhci_scan_qh(struct uhci_hcd *uhci, struct uhci_qh *qh)
 restart:
        list_for_each_entry(urbp, &qh->queue, node) {
                urb = urbp->urb;
-               if (urb->status != -EINPROGRESS) {
+               if (urb->unlinked) {
 
                        /* Fix up the TD links and save the toggles for
                         * non-Isochronous queues.  For Isochronous queues,
@@ -1605,7 +1590,7 @@ restart:
                                qh->is_stopped = 0;
                                return;
                        }
-                       uhci_giveback_urb(uhci, qh, urb);
+                       uhci_giveback_urb(uhci, qh, urb, 0);
                        goto restart;
                }
        }
This page took 0.04608 seconds and 5 git commands to generate.