aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-timer.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-03-22 13:31:45 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-03-25 16:35:05 -0400
commit6e018751a35f6ef7ad04eb8006b5886b6a7c47f5 (patch)
treee1dde22b7aa1ac3566ebbbd29b78df611e05c572 /drivers/usb/host/ehci-timer.c
parent7655e3160c78a18c2ecf7bf4dee0bbfe58575c7f (diff)
USB: EHCI: convert singly-linked lists to list_heads
This patch (as1664) converts ehci-hcd's async_unlink, async_iaa, and intr_unlink from singly-linked lists to standard doubly-linked list_heads. Originally it didn't seem necessary to use list_heads, because items are always added to and removed from these lists in FIFO order. But now with more list processing going on, it's easier to use the standard routines than continue with a roll-your-own approach. I don't know if the code ends up being notably shorter, but the patterns will be more familiar to any kernel hacker. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-timer.c')
-rw-r--r--drivers/usb/host/ehci-timer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-timer.c b/drivers/usb/host/ehci-timer.c
index e7363332887e..f63a98353efd 100644
--- a/drivers/usb/host/ehci-timer.c
+++ b/drivers/usb/host/ehci-timer.c
@@ -229,18 +229,19 @@ static void ehci_handle_intr_unlinks(struct ehci_hcd *ehci)
229 * process all the QHs on the list. 229 * process all the QHs on the list.
230 */ 230 */
231 ehci->intr_unlinking = true; 231 ehci->intr_unlinking = true;
232 while (ehci->intr_unlink) { 232 while (!list_empty(&ehci->intr_unlink)) {
233 struct ehci_qh *qh = ehci->intr_unlink; 233 struct ehci_qh *qh;
234 234
235 qh = list_first_entry(&ehci->intr_unlink, struct ehci_qh,
236 unlink_node);
235 if (!stopped && qh->unlink_cycle == ehci->intr_unlink_cycle) 237 if (!stopped && qh->unlink_cycle == ehci->intr_unlink_cycle)
236 break; 238 break;
237 ehci->intr_unlink = qh->unlink_next; 239 list_del(&qh->unlink_node);
238 qh->unlink_next = NULL;
239 end_unlink_intr(ehci, qh); 240 end_unlink_intr(ehci, qh);
240 } 241 }
241 242
242 /* Handle remaining entries later */ 243 /* Handle remaining entries later */
243 if (ehci->intr_unlink) { 244 if (!list_empty(&ehci->intr_unlink)) {
244 ehci_enable_event(ehci, EHCI_HRTIMER_UNLINK_INTR, true); 245 ehci_enable_event(ehci, EHCI_HRTIMER_UNLINK_INTR, true);
245 ++ehci->intr_unlink_cycle; 246 ++ehci->intr_unlink_cycle;
246 } 247 }