]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/host/isp116x-hcd.c
Merge branch 'avr32-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/hskinnemo...
[karo-tx-linux.git] / drivers / usb / host / isp116x-hcd.c
index f2b5d6281c5d6a163e5a7fdd36024aedb1a9807b..0130fd8571e4018549db9a5003bd432b72645878 100644 (file)
@@ -277,12 +277,11 @@ static void preproc_atl_queue(struct isp116x *isp116x)
   processed urbs.
 */
 static void finish_request(struct isp116x *isp116x, struct isp116x_ep *ep,
-                          struct urb *urb)
+                          struct urb *urb, int status)
 __releases(isp116x->lock) __acquires(isp116x->lock)
 {
        unsigned i;
 
-       urb->hcpriv = NULL;
        ep->error_count = 0;
 
        if (usb_pipecontrol(urb->pipe))
@@ -292,7 +291,7 @@ __releases(isp116x->lock) __acquires(isp116x->lock)
 
        usb_hcd_unlink_urb_from_ep(isp116x_to_hcd(isp116x), urb);
        spin_unlock(&isp116x->lock);
-       usb_hcd_giveback_urb(isp116x_to_hcd(isp116x), urb);
+       usb_hcd_giveback_urb(isp116x_to_hcd(isp116x), urb, status);
        spin_lock(&isp116x->lock);
 
        /* take idle endpoints out of the schedule */
@@ -446,12 +445,7 @@ static void postproc_atl_queue(struct isp116x *isp116x)
                        if (PTD_GET_ACTIVE(ptd)
                            || (cc != TD_CC_NOERROR && cc < 0x0E))
                                break;
-                       if ((urb->transfer_flags & URB_SHORT_NOT_OK) &&
-                                       urb->actual_length <
-                                               urb->transfer_buffer_length)
-                               status = -EREMOTEIO;
-                       else
-                               status = 0;
+                       status = 0;
                        ep->nextpid = 0;
                        break;
                default:
@@ -459,14 +453,8 @@ static void postproc_atl_queue(struct isp116x *isp116x)
                }
 
  done:
-               if (status != -EINPROGRESS) {
-                       spin_lock(&urb->lock);
-                       if (urb->status == -EINPROGRESS)
-                               urb->status = status;
-                       spin_unlock(&urb->lock);
-               }
-               if (urb->status != -EINPROGRESS)
-                       finish_request(isp116x, ep, urb);
+               if (status != -EINPROGRESS || urb->unlinked)
+                       finish_request(isp116x, ep, urb, status);
        }
 }
 
@@ -860,7 +848,7 @@ static int isp116x_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
                        }
 
        if (urb)
-               finish_request(isp116x, ep, urb);
+               finish_request(isp116x, ep, urb, status);
  done:
        spin_unlock_irqrestore(&isp116x->lock, flags);
        return rc;
@@ -930,7 +918,6 @@ static int isp116x_hub_status_data(struct usb_hcd *hcd, char *buf)
                              | RH_PS_OCIC | RH_PS_PRSC)) {
                        changed = 1;
                        buf[0] |= 1 << (i + 1);
-                       continue;
                }
        }
        spin_unlock_irqrestore(&isp116x->lock, flags);