diff options
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 4cad420d7708..0a4c86eeb385 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -1394,6 +1394,19 @@ static void xhci_handle_cmd_enable_slot(struct xhci_hcd *xhci, int slot_id, | |||
1394 | complete(&xhci->addr_dev); | 1394 | complete(&xhci->addr_dev); |
1395 | } | 1395 | } |
1396 | 1396 | ||
1397 | static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id) | ||
1398 | { | ||
1399 | struct xhci_virt_device *virt_dev; | ||
1400 | |||
1401 | virt_dev = xhci->devs[slot_id]; | ||
1402 | if (!virt_dev) | ||
1403 | return; | ||
1404 | if (xhci->quirks & XHCI_EP_LIMIT_QUIRK) | ||
1405 | /* Delete default control endpoint resources */ | ||
1406 | xhci_free_device_endpoint_resources(xhci, virt_dev, true); | ||
1407 | xhci_free_virt_device(xhci, slot_id); | ||
1408 | } | ||
1409 | |||
1397 | static void handle_cmd_completion(struct xhci_hcd *xhci, | 1410 | static void handle_cmd_completion(struct xhci_hcd *xhci, |
1398 | struct xhci_event_cmd *event) | 1411 | struct xhci_event_cmd *event) |
1399 | { | 1412 | { |
@@ -1451,13 +1464,7 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, | |||
1451 | GET_COMP_CODE(le32_to_cpu(event->status))); | 1464 | GET_COMP_CODE(le32_to_cpu(event->status))); |
1452 | break; | 1465 | break; |
1453 | case TRB_TYPE(TRB_DISABLE_SLOT): | 1466 | case TRB_TYPE(TRB_DISABLE_SLOT): |
1454 | if (xhci->devs[slot_id]) { | 1467 | xhci_handle_cmd_disable_slot(xhci, slot_id); |
1455 | if (xhci->quirks & XHCI_EP_LIMIT_QUIRK) | ||
1456 | /* Delete default control endpoint resources */ | ||
1457 | xhci_free_device_endpoint_resources(xhci, | ||
1458 | xhci->devs[slot_id], true); | ||
1459 | xhci_free_virt_device(xhci, slot_id); | ||
1460 | } | ||
1461 | break; | 1468 | break; |
1462 | case TRB_TYPE(TRB_CONFIG_EP): | 1469 | case TRB_TYPE(TRB_CONFIG_EP): |
1463 | virt_dev = xhci->devs[slot_id]; | 1470 | virt_dev = xhci->devs[slot_id]; |