diff options
author | Felipe Balbi <balbi@ti.com> | 2012-05-31 03:29:49 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-06-03 16:08:27 -0400 |
commit | ef21ede65ee3e0dfd8f2cb37de8892816e2f1257 (patch) | |
tree | eb66039a091b94d660b088fe73813e413f6accfa /drivers/usb/dwc3/ep0.c | |
parent | 5cbe8c220c1e126dd0855ad57fe4491b267132b9 (diff) |
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: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/ep0.c')
-rw-r--r-- | drivers/usb/dwc3/ep0.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c index e31bcd65e7ec..83fcf392dda7 100644 --- a/drivers/usb/dwc3/ep0.c +++ b/drivers/usb/dwc3/ep0.c | |||
@@ -641,11 +641,11 @@ static void dwc3_ep0_inspect_setup(struct dwc3 *dwc, | |||
641 | const struct dwc3_event_depevt *event) | 641 | const struct dwc3_event_depevt *event) |
642 | { | 642 | { |
643 | struct usb_ctrlrequest *ctrl = dwc->ctrl_req; | 643 | struct usb_ctrlrequest *ctrl = dwc->ctrl_req; |
644 | int ret; | 644 | int ret = -EINVAL; |
645 | u32 len; | 645 | u32 len; |
646 | 646 | ||
647 | if (!dwc->gadget_driver) | 647 | if (!dwc->gadget_driver) |
648 | goto err; | 648 | goto out; |
649 | 649 | ||
650 | len = le16_to_cpu(ctrl->wLength); | 650 | len = le16_to_cpu(ctrl->wLength); |
651 | if (!len) { | 651 | if (!len) { |
@@ -666,11 +666,9 @@ static void dwc3_ep0_inspect_setup(struct dwc3 *dwc, | |||
666 | if (ret == USB_GADGET_DELAYED_STATUS) | 666 | if (ret == USB_GADGET_DELAYED_STATUS) |
667 | dwc->delayed_status = true; | 667 | dwc->delayed_status = true; |
668 | 668 | ||
669 | if (ret >= 0) | 669 | out: |
670 | return; | 670 | if (ret < 0) |
671 | 671 | dwc3_ep0_stall_and_restart(dwc); | |
672 | err: | ||
673 | dwc3_ep0_stall_and_restart(dwc); | ||
674 | } | 672 | } |
675 | 673 | ||
676 | static void dwc3_ep0_complete_data(struct dwc3 *dwc, | 674 | static void dwc3_ep0_complete_data(struct dwc3 *dwc, |