aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-09-09 06:30:01 -0400
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-10-16 15:24:41 -0400
commitc69a059783b241c42188d472e2e9460d3cd4a4cc (patch)
tree9744b9a331c113eaece9539c61eeaacd110ca8f8 /drivers/usb/host/xhci-ring.c
parentb8200c9479b8046a16a71648607fa796b548218b (diff)
xhci: replace 'event' with 'cmd_comp_code' in set_deq and reset_ep handlers
This patch replaces the 'event' argument of xhci_handle_cmd_set_deq() and xhci_handle_cmd_reset_ep(), which is used to retrieve the command completion status code, with the cmd_comp_code directly, since it is available. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.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.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index b98c9852172a..e57163f952ed 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1073,7 +1073,7 @@ static void update_ring_for_set_deq_completion(struct xhci_hcd *xhci,
1073 * cancellations pending. 1073 * cancellations pending.
1074 */ 1074 */
1075static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id, 1075static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id,
1076 struct xhci_event_cmd *event, union xhci_trb *trb) 1076 union xhci_trb *trb, u32 cmd_comp_code)
1077{ 1077{
1078 unsigned int ep_index; 1078 unsigned int ep_index;
1079 unsigned int stream_id; 1079 unsigned int stream_id;
@@ -1099,11 +1099,11 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id,
1099 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); 1099 ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index);
1100 slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx); 1100 slot_ctx = xhci_get_slot_ctx(xhci, dev->out_ctx);
1101 1101
1102 if (GET_COMP_CODE(le32_to_cpu(event->status)) != COMP_SUCCESS) { 1102 if (cmd_comp_code != COMP_SUCCESS) {
1103 unsigned int ep_state; 1103 unsigned int ep_state;
1104 unsigned int slot_state; 1104 unsigned int slot_state;
1105 1105
1106 switch (GET_COMP_CODE(le32_to_cpu(event->status))) { 1106 switch (cmd_comp_code) {
1107 case COMP_TRB_ERR: 1107 case COMP_TRB_ERR:
1108 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd invalid because " 1108 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd invalid because "
1109 "of stream ID configuration\n"); 1109 "of stream ID configuration\n");
@@ -1126,7 +1126,7 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id,
1126 default: 1126 default:
1127 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd with unknown " 1127 xhci_warn(xhci, "WARN Set TR Deq Ptr cmd with unknown "
1128 "completion code of %u.\n", 1128 "completion code of %u.\n",
1129 GET_COMP_CODE(le32_to_cpu(event->status))); 1129 cmd_comp_code);
1130 break; 1130 break;
1131 } 1131 }
1132 /* OK what do we do now? The endpoint state is hosed, and we 1132 /* OK what do we do now? The endpoint state is hosed, and we
@@ -1164,7 +1164,7 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id,
1164} 1164}
1165 1165
1166static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id, 1166static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id,
1167 struct xhci_event_cmd *event, union xhci_trb *trb) 1167 union xhci_trb *trb, u32 cmd_comp_code)
1168{ 1168{
1169 unsigned int ep_index; 1169 unsigned int ep_index;
1170 1170
@@ -1173,8 +1173,7 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id,
1173 * but we don't care. 1173 * but we don't care.
1174 */ 1174 */
1175 xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, 1175 xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
1176 "Ignoring reset ep completion code of %u", 1176 "Ignoring reset ep completion code of %u", cmd_comp_code);
1177 GET_COMP_CODE(le32_to_cpu(event->status)));
1178 1177
1179 /* HW with the reset endpoint quirk needs to have a configure endpoint 1178 /* HW with the reset endpoint quirk needs to have a configure endpoint
1180 * command complete before the endpoint can be used. Queue that here 1179 * command complete before the endpoint can be used. Queue that here
@@ -1576,14 +1575,14 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,
1576 case TRB_SET_DEQ: 1575 case TRB_SET_DEQ:
1577 WARN_ON(slot_id != TRB_TO_SLOT_ID( 1576 WARN_ON(slot_id != TRB_TO_SLOT_ID(
1578 le32_to_cpu(cmd_trb->generic.field[3]))); 1577 le32_to_cpu(cmd_trb->generic.field[3])));
1579 xhci_handle_cmd_set_deq(xhci, slot_id, event, cmd_trb); 1578 xhci_handle_cmd_set_deq(xhci, slot_id, cmd_trb, cmd_comp_code);
1580 break; 1579 break;
1581 case TRB_CMD_NOOP: 1580 case TRB_CMD_NOOP:
1582 break; 1581 break;
1583 case TRB_RESET_EP: 1582 case TRB_RESET_EP:
1584 WARN_ON(slot_id != TRB_TO_SLOT_ID( 1583 WARN_ON(slot_id != TRB_TO_SLOT_ID(
1585 le32_to_cpu(cmd_trb->generic.field[3]))); 1584 le32_to_cpu(cmd_trb->generic.field[3])));
1586 xhci_handle_cmd_reset_ep(xhci, slot_id, event, cmd_trb); 1585 xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);
1587 break; 1586 break;
1588 case TRB_RESET_DEV: 1587 case TRB_RESET_DEV:
1589 WARN_ON(slot_id != TRB_TO_SLOT_ID( 1588 WARN_ON(slot_id != TRB_TO_SLOT_ID(