Hello.
David Brownell wrote:
@@ -2141,13 +2142,22 @@ musb_h_disable(struct usb_hcd *hcd, stru
/* cleanup */
musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN);
- } else
- urb = NULL;
-
- /* then just nuke all the others */
- list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list)
- musb_giveback(qh, urb, -ESHUTDOWN);
+ /* Then just nuke all the others */
+ while (!list_empty(&hep->urb_list)) {
+ urb = next_urb(qh);
+ urb->status = -ESHUTDOWN;
+ musb_advance_schedule(musb, urb, qh->hw_ep, is_in);
+ }
+ } else {
+ while (!list_empty(&hep->urb_list))
+ __musb_giveback(musb, next_urb(qh), -ESHUTDOWN);
Why does this have two different code paths for the
"unlink everything that the hardware doesn't have its
mittens on" branch?
Exactly because this cases needs to be handled differently. Re-read
the patch description please.
It certainly *looks* goofy this way, and if it's not
What *ceartainly* looked goofy is the "code" that was there before
this patch.
buggy today then it'll probably grow some in the future.
Care to elaborate why?
Could you update this to settle on a single while()
loop?
Certainly not.
I'd suggest the "else" branch as being simpler.
Think again please and re-read the patch description.
- Dave
WBR., Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html