aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-09-09 06:29:53 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-10-16 15:24:31 -0400
commit07948a8da6241984b8359830498855573d552d0d (patch)
treee77ee2a9b62680069b1593ee44f51e2e8e972308 /drivers/usb/host
parent2c070821e2b2ce2e75861b2b56062df1757b9183 (diff)
xhci: refactor TRB_EVAL_CONTEXT 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_EVAL_CONTEXT switch case in handle_cmd_completion() into a fuction named xhci_handle_cmd_eval_ctx(). 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')
-rw-r--r--drivers/usb/host/xhci-ring.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index f926a81c0417..39a2bfbeefb5 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1407,6 +1407,18 @@ 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_eval_ctx(struct xhci_hcd *xhci, int slot_id,
1411 struct xhci_event_cmd *event, u32 cmd_comp_code)
1412{
1413 struct xhci_virt_device *virt_dev;
1414
1415 virt_dev = xhci->devs[slot_id];
1416 if (handle_cmd_in_cmd_wait_list(xhci, virt_dev, event))
1417 return;
1418 virt_dev->cmd_status = cmd_comp_code;
1419 complete(&virt_dev->cmd_completion);
1420}
1421
1410static void xhci_handle_cmd_addr_dev(struct xhci_hcd *xhci, int slot_id, 1422static void xhci_handle_cmd_addr_dev(struct xhci_hcd *xhci, int slot_id,
1411 u32 cmd_comp_code) 1423 u32 cmd_comp_code)
1412{ 1424{
@@ -1552,11 +1564,8 @@ bandwidth_change:
1552 complete(&xhci->devs[slot_id]->cmd_completion); 1564 complete(&xhci->devs[slot_id]->cmd_completion);
1553 break; 1565 break;
1554 case TRB_TYPE(TRB_EVAL_CONTEXT): 1566 case TRB_TYPE(TRB_EVAL_CONTEXT):
1555 virt_dev = xhci->devs[slot_id]; 1567 xhci_handle_cmd_eval_ctx(xhci, slot_id, event,
1556 if (handle_cmd_in_cmd_wait_list(xhci, virt_dev, event)) 1568 GET_COMP_CODE(le32_to_cpu(event->status)));
1557 break;
1558 xhci->devs[slot_id]->cmd_status = GET_COMP_CODE(le32_to_cpu(event->status));
1559 complete(&xhci->devs[slot_id]->cmd_completion);
1560 break; 1569 break;
1561 case TRB_TYPE(TRB_ADDR_DEV): 1570 case TRB_TYPE(TRB_ADDR_DEV):
1562 xhci_handle_cmd_addr_dev(xhci, slot_id, 1571 xhci_handle_cmd_addr_dev(xhci, slot_id,