aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPratyush Anand <pratyush.anand@st.com>2012-06-22 16:53:08 -0400
committerFelipe Balbi <balbi@ti.com>2012-06-25 06:59:26 -0400
commit3daf74d78dfcd552445c35f1b82a271ca305ceb9 (patch)
tree6d0ebe71a84bacb601324922e210af1fb9bbff11 /drivers
parent58a0f23fddd0a71d8fa22e6ef7627298a8ed29a6 (diff)
usb: dwc3: remove WARN_ON from dwc_stop_active_transfer
Now we are sure that, if res_trans_idx is zero, then endpoint has been stopped. So it's safe to just return if endpoint is already stopped. No need to generate warning anymore. While doing so, it's better to return when res_trans_idx is zero and decrease one level of indentation. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> [ balbi@ti.com: slightly changed commit log ] Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/dwc3/gadget.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index f6fb42da2e64..9ac4835d7b6b 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1870,16 +1870,16 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
1870 1870
1871 dep = dwc->eps[epnum]; 1871 dep = dwc->eps[epnum];
1872 1872
1873 WARN_ON(!dep->res_trans_idx); 1873 if (!dep->res_trans_idx)
1874 if (dep->res_trans_idx) { 1874 return;
1875 cmd = DWC3_DEPCMD_ENDTRANSFER; 1875
1876 cmd |= DWC3_DEPCMD_HIPRI_FORCERM | DWC3_DEPCMD_CMDIOC; 1876 cmd = DWC3_DEPCMD_ENDTRANSFER;
1877 cmd |= DWC3_DEPCMD_PARAM(dep->res_trans_idx); 1877 cmd |= DWC3_DEPCMD_HIPRI_FORCERM | DWC3_DEPCMD_CMDIOC;
1878 memset(&params, 0, sizeof(params)); 1878 cmd |= DWC3_DEPCMD_PARAM(dep->res_trans_idx);
1879 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params); 1879 memset(&params, 0, sizeof(params));
1880 WARN_ON_ONCE(ret); 1880 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
1881 dep->res_trans_idx = 0; 1881 WARN_ON_ONCE(ret);
1882 } 1882 dep->res_trans_idx = 0;
1883} 1883}
1884 1884
1885static void dwc3_stop_active_transfers(struct dwc3 *dwc) 1885static void dwc3_stop_active_transfers(struct dwc3 *dwc)