aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-09-09 06:29:49 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-10-16 15:24:27 -0400
commit9b3103ac9d19525781c297c4fb1e544e077c8901 (patch)
tree85978ba2085abd113a3a90682d6a16a62bf8fd22 /drivers/usb/host/xhci-ring.c
parent6c02dd147a7a3dbbfc7451abbf58b3b2a2a5483d (diff)
xhci: refactor TRB_ADDR_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_ADDR_DEV switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_addr_dev(). Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 0a4c86eeb385..e3b61b834aeb 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1407,6 +1407,13 @@ static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id)
1407 xhci_free_virt_device(xhci, slot_id); 1407 xhci_free_virt_device(xhci, slot_id);
1408} 1408}
1409 1409
1410static void xhci_handle_cmd_addr_dev(struct xhci_hcd *xhci, int slot_id,
1411 u32 cmd_comp_code)
1412{
1413 xhci->devs[slot_id]->cmd_status = cmd_comp_code;
1414 complete(&xhci->addr_dev);
1415}
1416
1410static void handle_cmd_completion(struct xhci_hcd *xhci, 1417static void handle_cmd_completion(struct xhci_hcd *xhci,
1411 struct xhci_event_cmd *event) 1418 struct xhci_event_cmd *event)
1412{ 1419{
@@ -1525,8 +1532,8 @@ bandwidth_change:
1525 complete(&xhci->devs[slot_id]->cmd_completion); 1532 complete(&xhci->devs[slot_id]->cmd_completion);
1526 break; 1533 break;
1527 case TRB_TYPE(TRB_ADDR_DEV): 1534 case TRB_TYPE(TRB_ADDR_DEV):
1528 xhci->devs[slot_id]->cmd_status = GET_COMP_CODE(le32_to_cpu(event->status)); 1535 xhci_handle_cmd_addr_dev(xhci, slot_id,
1529 complete(&xhci->addr_dev); 1536 GET_COMP_CODE(le32_to_cpu(event->status)));
1530 break; 1537 break;
1531 case TRB_TYPE(TRB_STOP_RING): 1538 case TRB_TYPE(TRB_STOP_RING):
1532 xhci_handle_cmd_stop_ep(xhci, xhci->cmd_ring->dequeue, event); 1539 xhci_handle_cmd_stop_ep(xhci, xhci->cmd_ring->dequeue, event);