Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310912
b: refs/heads/master
c: 32f1d2c
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Sarah Sharp committed Jun 13, 2012
1 parent e423e27 commit 9fa0f24
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 46ed8f00d8982e49f8fe2c1a9cea192f640cb3ba
refs/heads/master: 32f1d2c536d0c26c5814cb0e6a0606c42d02fac1
35 changes: 14 additions & 21 deletions trunk/drivers/usb/host/xhci-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1772,17 +1772,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
{
struct pci_dev *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
struct dev_info *dev_info, *next;
struct list_head *tt_list_head;
struct list_head *tt;
struct list_head *endpoints;
struct list_head *ep, *q;
struct xhci_tt_bw_info *tt_info;
struct xhci_interval_bw_table *bwt;
struct xhci_virt_ep *virt_ep;

unsigned long flags;
int size;
int i;
int i, j, num_ports;

/* Free the Event Ring Segment Table and the actual Event Ring */
size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries);
Expand Down Expand Up @@ -1841,21 +1833,22 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
}
spin_unlock_irqrestore(&xhci->lock, flags);

bwt = &xhci->rh_bw->bw_table;
for (i = 0; i < XHCI_MAX_INTERVAL; i++) {
endpoints = &bwt->interval_bw[i].endpoints;
list_for_each_safe(ep, q, endpoints) {
virt_ep = list_entry(ep, struct xhci_virt_ep, bw_endpoint_list);
list_del(&virt_ep->bw_endpoint_list);
kfree(virt_ep);
num_ports = HCS_MAX_PORTS(xhci->hcs_params1);
for (i = 0; i < num_ports; i++) {
struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table;
for (j = 0; j < XHCI_MAX_INTERVAL; j++) {
struct list_head *ep = &bwt->interval_bw[j].endpoints;
while (!list_empty(ep))
list_del_init(ep->next);
}
}

tt_list_head = &xhci->rh_bw->tts;
list_for_each_safe(tt, q, tt_list_head) {
tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list);
list_del(tt);
kfree(tt_info);
for (i = 0; i < num_ports; i++) {
struct xhci_tt_bw_info *tt, *n;
list_for_each_entry_safe(tt, n, &xhci->rh_bw[i].tts, tt_list) {
list_del(&tt->tt_list);
kfree(tt);
}
}

xhci->num_usb2_ports = 0;
Expand Down

0 comments on commit 9fa0f24

Please sign in to comment.