diff options
Diffstat (limited to 'drivers/usb/host/xhci-hcd.c')
-rw-r--r-- | drivers/usb/host/xhci-hcd.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/usb/host/xhci-hcd.c b/drivers/usb/host/xhci-hcd.c index 0c5c1b2f3263..451f53eec6d7 100644 --- a/drivers/usb/host/xhci-hcd.c +++ b/drivers/usb/host/xhci-hcd.c | |||
@@ -1266,30 +1266,13 @@ int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) | |||
1266 | xhci_zero_in_ctx(xhci, virt_dev); | 1266 | xhci_zero_in_ctx(xhci, virt_dev); |
1267 | /* Install new rings and free or cache any old rings */ | 1267 | /* Install new rings and free or cache any old rings */ |
1268 | for (i = 1; i < 31; ++i) { | 1268 | for (i = 1; i < 31; ++i) { |
1269 | int rings_cached; | ||
1270 | |||
1271 | if (!virt_dev->eps[i].new_ring) | 1269 | if (!virt_dev->eps[i].new_ring) |
1272 | continue; | 1270 | continue; |
1273 | /* Only cache or free the old ring if it exists. | 1271 | /* Only cache or free the old ring if it exists. |
1274 | * It may not if this is the first add of an endpoint. | 1272 | * It may not if this is the first add of an endpoint. |
1275 | */ | 1273 | */ |
1276 | if (virt_dev->eps[i].ring) { | 1274 | if (virt_dev->eps[i].ring) { |
1277 | rings_cached = virt_dev->num_rings_cached; | 1275 | xhci_free_or_cache_endpoint_ring(xhci, virt_dev, i); |
1278 | if (rings_cached < XHCI_MAX_RINGS_CACHED) { | ||
1279 | virt_dev->num_rings_cached++; | ||
1280 | rings_cached = virt_dev->num_rings_cached; | ||
1281 | virt_dev->ring_cache[rings_cached] = | ||
1282 | virt_dev->eps[i].ring; | ||
1283 | xhci_dbg(xhci, "Cached old ring, " | ||
1284 | "%d ring%s cached\n", | ||
1285 | rings_cached, | ||
1286 | (rings_cached > 1) ? "s" : ""); | ||
1287 | } else { | ||
1288 | xhci_ring_free(xhci, virt_dev->eps[i].ring); | ||
1289 | xhci_dbg(xhci, "Ring cache full (%d rings), " | ||
1290 | "freeing ring\n", | ||
1291 | virt_dev->num_rings_cached); | ||
1292 | } | ||
1293 | } | 1276 | } |
1294 | virt_dev->eps[i].ring = virt_dev->eps[i].new_ring; | 1277 | virt_dev->eps[i].ring = virt_dev->eps[i].new_ring; |
1295 | virt_dev->eps[i].new_ring = NULL; | 1278 | virt_dev->eps[i].new_ring = NULL; |