提交 3daf74d7 编写于 作者: P Pratyush Anand 提交者: Felipe Balbi

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: NPratyush Anand <pratyush.anand@st.com>

[ balbi@ti.com: slightly changed commit log ]
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 58a0f23f
......@@ -1870,16 +1870,16 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
dep = dwc->eps[epnum];
WARN_ON(!dep->res_trans_idx);
if (dep->res_trans_idx) {
cmd = DWC3_DEPCMD_ENDTRANSFER;
cmd |= DWC3_DEPCMD_HIPRI_FORCERM | DWC3_DEPCMD_CMDIOC;
cmd |= DWC3_DEPCMD_PARAM(dep->res_trans_idx);
memset(&params, 0, sizeof(params));
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
WARN_ON_ONCE(ret);
dep->res_trans_idx = 0;
}
if (!dep->res_trans_idx)
return;
cmd = DWC3_DEPCMD_ENDTRANSFER;
cmd |= DWC3_DEPCMD_HIPRI_FORCERM | DWC3_DEPCMD_CMDIOC;
cmd |= DWC3_DEPCMD_PARAM(dep->res_trans_idx);
memset(&params, 0, sizeof(params));
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
WARN_ON_ONCE(ret);
dep->res_trans_idx = 0;
}
static void dwc3_stop_active_transfers(struct dwc3 *dwc)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部