usb: dwc3: gadget: remove some pointless checks
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 27 Mar 2018 07:41:39 +0000 (10:41 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 21 May 2018 07:00:50 +0000 (10:00 +0300)
We *KNOW* which events we enable for which endpoint types and
we *KNOW* when they'll trigger. The endpoint type checks are
pointless.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c

index 298b3fd..65cdb54 100644 (file)
@@ -2503,21 +2503,8 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
                dwc3_gadget_endpoint_transfer_in_progress(dwc, dep, event);
                break;
        case DWC3_DEPEVT_XFERNOTREADY:
                dwc3_gadget_endpoint_transfer_in_progress(dwc, dep, event);
                break;
        case DWC3_DEPEVT_XFERNOTREADY:
-               if (!usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
-                       dev_err(dwc->dev, "XferNotReady for non-Isoc %s\n",
-                                       dep->name);
-                       return;
-               }
-
                dwc3_gadget_start_isoc(dwc, dep, event);
                break;
                dwc3_gadget_start_isoc(dwc, dep, event);
                break;
-       case DWC3_DEPEVT_STREAMEVT:
-               if (!usb_endpoint_xfer_bulk(dep->endpoint.desc)) {
-                       dev_err(dwc->dev, "Stream event for non-Bulk %s\n",
-                                       dep->name);
-                       return;
-               }
-               break;
        case DWC3_DEPEVT_EPCMDCMPLT:
                cmd = DEPEVT_PARAMETER_CMD(event->parameters);
 
        case DWC3_DEPEVT_EPCMDCMPLT:
                cmd = DEPEVT_PARAMETER_CMD(event->parameters);
 
@@ -2526,6 +2513,7 @@ static void dwc3_endpoint_interrupt(struct dwc3 *dwc,
                        wake_up(&dep->wait_end_transfer);
                }
                break;
                        wake_up(&dep->wait_end_transfer);
                }
                break;
+       case DWC3_DEPEVT_STREAMEVT:
        case DWC3_DEPEVT_XFERCOMPLETE:
        case DWC3_DEPEVT_RXTXFIFOEVT:
                break;
        case DWC3_DEPEVT_XFERCOMPLETE:
        case DWC3_DEPEVT_RXTXFIFOEVT:
                break;