aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-09-09 06:29:51 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-10-16 15:24:29 -0400
commitf681321b40d77fa360b8b2155af95cd5959d2dde (patch)
tree14abf9b233421038b8c0c1690094fb9428610f07
parent20e7acb13ff48fbc884d5918c3697c27de63922a (diff)
xhci: refactor TRB_RESET_DEV case into function
The function that handles xHCI command completion is much too long and there is need to be broken up into individual functions for each command completion to improve code readablity. This patch refactors the code in TRB_RESET_DEV switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_reset_dev(). Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
-rw-r--r--drivers/usb/host/xhci-ring.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 88939b798ac6..64442ac995d9 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1414,6 +1414,20 @@ static void xhci_handle_cmd_addr_dev(struct xhci_hcd *xhci, int slot_id,
1414 complete(&xhci->addr_dev); 1414 complete(&xhci->addr_dev);
1415} 1415}
1416 1416
1417static void xhci_handle_cmd_reset_dev(struct xhci_hcd *xhci, int slot_id,
1418 struct xhci_event_cmd *event)
1419{
1420 struct xhci_virt_device *virt_dev;
1421
1422 xhci_dbg(xhci, "Completed reset device command.\n");
1423 virt_dev = xhci->devs[slot_id];
1424 if (virt_dev)
1425 handle_cmd_in_cmd_wait_list(xhci, virt_dev, event);
1426 else
1427 xhci_warn(xhci, "Reset device command completion "
1428 "for disabled slot %u\n", slot_id);
1429}
1430
1417static void handle_cmd_completion(struct xhci_hcd *xhci, 1431static void handle_cmd_completion(struct xhci_hcd *xhci,
1418 struct xhci_event_cmd *event) 1432 struct xhci_event_cmd *event)
1419{ 1433{
@@ -1549,13 +1563,7 @@ bandwidth_change:
1549 case TRB_TYPE(TRB_RESET_DEV): 1563 case TRB_TYPE(TRB_RESET_DEV):
1550 WARN_ON(slot_id != TRB_TO_SLOT_ID( 1564 WARN_ON(slot_id != TRB_TO_SLOT_ID(
1551 le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3]))); 1565 le32_to_cpu(xhci->cmd_ring->dequeue->generic.field[3])));
1552 xhci_dbg(xhci, "Completed reset device command.\n"); 1566 xhci_handle_cmd_reset_dev(xhci, slot_id, event);
1553 virt_dev = xhci->devs[slot_id];
1554 if (virt_dev)
1555 handle_cmd_in_cmd_wait_list(xhci, virt_dev, event);
1556 else
1557 xhci_warn(xhci, "Reset device command completion "
1558 "for disabled slot %u\n", slot_id);
1559 break; 1567 break;
1560 case TRB_TYPE(TRB_NEC_GET_FW): 1568 case TRB_TYPE(TRB_NEC_GET_FW):
1561 if (!(xhci->quirks & XHCI_NEC_HOST)) { 1569 if (!(xhci->quirks & XHCI_NEC_HOST)) {