summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
authorFelipe Balbi <felipe.balbi@linux.intel.com>2016-05-23 14:02:33 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2016-06-20 12:32:40 +0300
commit0933df159c5c82f97c6bb811b149fa1158a26087 (patch)
tree4961d2b608d9804c972167909adbb78cde3f9d11 /drivers/usb/dwc3/gadget.c
parentf6bb225bb3ca7988ff373c62cc298e56cae1eee5 (diff)
downloadlwn-0933df159c5c82f97c6bb811b149fa1158a26087.tar.gz
lwn-0933df159c5c82f97c6bb811b149fa1158a26087.zip
usb: dwc3: trace: print ep cmd status with a single trace
Instead of printing command's status with a separate trace printout, let's print it within a single call. Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 25170fd5fbd4..42eefd7c99ef 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -248,11 +248,10 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
u32 timeout = 500;
u32 reg;
+ int cmd_status = 0;
int susphy = false;
int ret = -EINVAL;
- trace_dwc3_gadget_ep_cmd(dep, cmd, params);
-
/*
* Synopsys Databook 2.60a states, on section 6.3.2.5.[1-8], that if
* we're issuing an endpoint command, we must check if
@@ -292,7 +291,7 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
do {
reg = dwc3_readl(dep->regs, DWC3_DEPCMD);
if (!(reg & DWC3_DEPCMD_CMDACT)) {
- int cmd_status = DWC3_DEPCMD_STATUS(reg);
+ cmd_status = DWC3_DEPCMD_STATUS(reg);
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
@@ -333,8 +332,11 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned cmd,
dwc3_trace(trace_dwc3_gadget,
"Command Timed Out");
ret = -ETIMEDOUT;
+ cmd_status = -ETIMEDOUT;
}
+ trace_dwc3_gadget_ep_cmd(dep, cmd, params, cmd_status);
+
if (unlikely(susphy)) {
reg = dwc3_readl(dwc->regs, DWC3_GUSB2PHYCFG(0));
reg |= DWC3_GUSB2PHYCFG_SUSPHY;