usb: dwc3: ep0: drop dead code
authorFelipe Balbi <balbi@ti.com>
Thu, 19 Jul 2012 05:53:41 +0000 (08:53 +0300)
committerFelipe Balbi <balbi@ti.com>
Fri, 3 Aug 2012 06:28:25 +0000 (09:28 +0300)
There's no such thing as XferNotReady(SETUP), we
can safely drop all that code with no problems
whatsoever.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/ep0.c

index 151eca876dfd17845b071a7f1528105250d47aaa..c611d80233682047a1ea9009606a741810353617 100644 (file)
@@ -457,7 +457,6 @@ enum dwc3_phy {
 enum dwc3_ep0_next {
        DWC3_EP0_UNKNOWN = 0,
        DWC3_EP0_COMPLETE,
-       DWC3_EP0_NRDY_SETUP,
        DWC3_EP0_NRDY_DATA,
        DWC3_EP0_NRDY_STATUS,
 };
@@ -779,7 +778,6 @@ struct dwc3_event_depevt {
 #define DEPEVT_STREAMEVT_NOTFOUND      2
 
 /* Control-only Status */
-#define DEPEVT_STATUS_CONTROL_SETUP    0
 #define DEPEVT_STATUS_CONTROL_DATA     1
 #define DEPEVT_STATUS_CONTROL_STATUS   2
 
index 28bce9be30bc3a200d0e9fd8237e020be092a1a8..d4b38c72a0ac30d93ba6689163148fb5c1faa7af 100644 (file)
@@ -809,12 +809,6 @@ static void dwc3_ep0_xfer_complete(struct dwc3 *dwc,
        }
 }
 
-static void dwc3_ep0_do_control_setup(struct dwc3 *dwc,
-               const struct dwc3_event_depevt *event)
-{
-       dwc3_ep0_out_start(dwc);
-}
-
 static void __dwc3_ep0_do_control_data(struct dwc3 *dwc,
                struct dwc3_ep *dep, struct dwc3_request *req)
 {
@@ -926,50 +920,7 @@ static void dwc3_ep0_xfernotready(struct dwc3 *dwc,
 {
        dwc->setup_packet_pending = true;
 
-       /*
-        * This part is very tricky: If we have just handled
-        * XferNotReady(Setup) and we're now expecting a
-        * XferComplete but, instead, we receive another
-        * XferNotReady(Setup), we should STALL and restart
-        * the state machine.
-        *
-        * In all other cases, we just continue waiting
-        * for the XferComplete event.
-        *
-        * We are a little bit unsafe here because we're
-        * not trying to ensure that last event was, indeed,
-        * XferNotReady(Setup).
-        *
-        * Still, we don't expect any condition where that
-        * should happen and, even if it does, it would be
-        * another error condition.
-        */
-       if (dwc->ep0_next_event == DWC3_EP0_COMPLETE) {
-               switch (event->status) {
-               case DEPEVT_STATUS_CONTROL_SETUP:
-                       dev_vdbg(dwc->dev, "Unexpected XferNotReady(Setup)\n");
-                       dwc3_ep0_stall_and_restart(dwc);
-                       break;
-               case DEPEVT_STATUS_CONTROL_DATA:
-                       /* FALLTHROUGH */
-               case DEPEVT_STATUS_CONTROL_STATUS:
-                       /* FALLTHROUGH */
-               default:
-                       dev_vdbg(dwc->dev, "waiting for XferComplete\n");
-               }
-
-               return;
-       }
-
        switch (event->status) {
-       case DEPEVT_STATUS_CONTROL_SETUP:
-               dev_vdbg(dwc->dev, "Control Setup\n");
-
-               dwc->ep0state = EP0_SETUP_PHASE;
-
-               dwc3_ep0_do_control_setup(dwc, event);
-               break;
-
        case DEPEVT_STATUS_CONTROL_DATA:
                dev_vdbg(dwc->dev, "Control Data\n");