Commit ef21ede6 authored by Felipe Balbi's avatar Felipe Balbi

usb: dwc3: ep0: simplify error handling on dwc3_ep0_inspect_setup

There's no need for returning early. Instead,
we can call dwc3_ep0_stall_and_restart()
conditionally.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 5cbe8c22
...@@ -641,11 +641,11 @@ static void dwc3_ep0_inspect_setup(struct dwc3 *dwc, ...@@ -641,11 +641,11 @@ static void dwc3_ep0_inspect_setup(struct dwc3 *dwc,
const struct dwc3_event_depevt *event) const struct dwc3_event_depevt *event)
{ {
struct usb_ctrlrequest *ctrl = dwc->ctrl_req; struct usb_ctrlrequest *ctrl = dwc->ctrl_req;
int ret; int ret = -EINVAL;
u32 len; u32 len;
if (!dwc->gadget_driver) if (!dwc->gadget_driver)
goto err; goto out;
len = le16_to_cpu(ctrl->wLength); len = le16_to_cpu(ctrl->wLength);
if (!len) { if (!len) {
...@@ -666,10 +666,8 @@ static void dwc3_ep0_inspect_setup(struct dwc3 *dwc, ...@@ -666,10 +666,8 @@ static void dwc3_ep0_inspect_setup(struct dwc3 *dwc,
if (ret == USB_GADGET_DELAYED_STATUS) if (ret == USB_GADGET_DELAYED_STATUS)
dwc->delayed_status = true; dwc->delayed_status = true;
if (ret >= 0) out:
return; if (ret < 0)
err:
dwc3_ep0_stall_and_restart(dwc); dwc3_ep0_stall_and_restart(dwc);
} }
......
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