USB: centralize -EREMOTEIO handling
This patch (as969) continues the ongoing changes to the way HCDs report URB statuses. The programming interface has been simplified by making usbcore responsible for clearing urb->hcpriv and for setting -EREMOTEIO status when an URB with the URB_SHORT_NOT_OK flag ends up as a short transfer. By moving the work out of the HCDs, this removes a fair amount of repeated code. 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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
ee7d1f3f0c
commit
b0d9efba3e
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
Reference in New Issue
Block a user