aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ohci-hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-08-24 15:40:34 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:55:21 -0400
commit55d8496837cf124f68656e4242a5e20eb592fd54 (patch)
treea188b3630a20cf7098833a95124e01ed438f3b7c /drivers/usb/host/ohci-hcd.c
parent14c04c0f88f228fee1f412be91d6edcb935c78aa (diff)
USB: reorganize urb->status use in ohci-hcd
This patch (as975) reorganizes the way ohci-hcd sets urb->status. It now keeps the information in a local variable until the last moment. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: David Brownell <david-b@pacbell.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/ohci-hcd.c')
-rw-r--r--drivers/usb/host/ohci-hcd.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 6b06ab69938f..f7c6ced2bc03 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -129,7 +129,7 @@ static int ohci_urb_enqueue (
129 int retval = 0; 129 int retval = 0;
130 130
131#ifdef OHCI_VERBOSE_DEBUG 131#ifdef OHCI_VERBOSE_DEBUG
132 urb_print (urb, "SUB", usb_pipein (pipe)); 132 urb_print(urb, "SUB", usb_pipein(pipe), -EINPROGRESS);
133#endif 133#endif
134 134
135 /* every endpoint has a ed, locate and maybe (re)initialize it */ 135 /* every endpoint has a ed, locate and maybe (re)initialize it */
@@ -240,8 +240,8 @@ fail:
240} 240}
241 241
242/* 242/*
243 * decouple the URB from the HC queues (TDs, urb_priv); it's 243 * decouple the URB from the HC queues (TDs, urb_priv).
244 * already marked using urb->status. reporting is always done 244 * reporting is always done
245 * asynchronously, and we might be dealing with an urb that's 245 * asynchronously, and we might be dealing with an urb that's
246 * partially transferred, or an ED with other urbs being unlinked. 246 * partially transferred, or an ED with other urbs being unlinked.
247 */ 247 */
@@ -252,7 +252,7 @@ static int ohci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
252 int rc; 252 int rc;
253 253
254#ifdef OHCI_VERBOSE_DEBUG 254#ifdef OHCI_VERBOSE_DEBUG
255 urb_print (urb, "UNLINK", 1); 255 urb_print(urb, "UNLINK", 1, status);
256#endif 256#endif
257 257
258 spin_lock_irqsave (&ohci->lock, flags); 258 spin_lock_irqsave (&ohci->lock, flags);
@@ -277,7 +277,7 @@ static int ohci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
277 * any more ... just clean up every urb's memory. 277 * any more ... just clean up every urb's memory.
278 */ 278 */
279 if (urb->hcpriv) 279 if (urb->hcpriv)
280 finish_urb (ohci, urb); 280 finish_urb(ohci, urb, status);
281 } 281 }
282 spin_unlock_irqrestore (&ohci->lock, flags); 282 spin_unlock_irqrestore (&ohci->lock, flags);
283 return rc; 283 return rc;
@@ -927,9 +927,8 @@ static int ohci_restart (struct ohci_hcd *ohci)
927 ed, ed->state); 927 ed, ed->state);
928 } 928 }
929 929
930 spin_lock (&urb->lock); 930 if (!urb->unlinked)
931 urb->status = -ESHUTDOWN; 931 urb->unlinked = -ESHUTDOWN;
932 spin_unlock (&urb->lock);
933 } 932 }
934 finish_unlinks (ohci, 0); 933 finish_unlinks (ohci, 0);
935 spin_unlock_irq(&ohci->lock); 934 spin_unlock_irq(&ohci->lock);