Commit 9b3103ac authored by Xenia Ragiadakou's avatar Xenia Ragiadakou Committed by Sarah Sharp

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: default avatarXenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
parent 6c02dd14
...@@ -1407,6 +1407,13 @@ static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id) ...@@ -1407,6 +1407,13 @@ static void xhci_handle_cmd_disable_slot(struct xhci_hcd *xhci, int slot_id)
xhci_free_virt_device(xhci, slot_id); xhci_free_virt_device(xhci, slot_id);
} }
static void xhci_handle_cmd_addr_dev(struct xhci_hcd *xhci, int slot_id,
u32 cmd_comp_code)
{
xhci->devs[slot_id]->cmd_status = cmd_comp_code;
complete(&xhci->addr_dev);
}
static void handle_cmd_completion(struct xhci_hcd *xhci, static void handle_cmd_completion(struct xhci_hcd *xhci,
struct xhci_event_cmd *event) struct xhci_event_cmd *event)
{ {
...@@ -1525,8 +1532,8 @@ static void handle_cmd_completion(struct xhci_hcd *xhci, ...@@ -1525,8 +1532,8 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
complete(&xhci->devs[slot_id]->cmd_completion); complete(&xhci->devs[slot_id]->cmd_completion);
break; break;
case TRB_TYPE(TRB_ADDR_DEV): case TRB_TYPE(TRB_ADDR_DEV):
xhci->devs[slot_id]->cmd_status = GET_COMP_CODE(le32_to_cpu(event->status)); xhci_handle_cmd_addr_dev(xhci, slot_id,
complete(&xhci->addr_dev); GET_COMP_CODE(le32_to_cpu(event->status)));
break; break;
case TRB_TYPE(TRB_STOP_RING): case TRB_TYPE(TRB_STOP_RING):
xhci_handle_cmd_stop_ep(xhci, xhci->cmd_ring->dequeue, event); xhci_handle_cmd_stop_ep(xhci, xhci->cmd_ring->dequeue, event);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment