UPSTREAM: usb: dwc3: gadget: no more tracking endpoint type with its name
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 23 May 2016 08:27:26 +0000 (11:27 +0300)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
I really thought this would be useful, but as it
turns out, it creates more problems than fixes. The
amount of times we had to fix this because some
other commit shuffled things around and ended up
regressing this tiny little string manupulation...

Might as well remove it, since it has a negligible
added benefit.

Change-Id: I6b64399df59313f6572df7dfd93c35e2894377b5
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 7ab373aadbd0463c0f020d368947b05e67a20bd5)

drivers/usb/dwc3/gadget.c

index 89ff8dec20d8152cfed1f22d7e95da5e847e1f4d..aba207a69fcf1d7dbb671d80e7c48716509f867d 100644 (file)
@@ -591,7 +591,7 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
                dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
 
                if (usb_endpoint_xfer_control(desc))
-                       goto out;
+                       return 0;
 
                /* Link TRB. The HWO bit is never reset */
                trb_st_hw = &dep->trb_pool[0];
@@ -605,24 +605,6 @@ static int __dwc3_gadget_ep_enable(struct dwc3_ep *dep,
                trb_link->ctrl |= DWC3_TRB_CTRL_HWO;
        }
 
-out:
-       switch (usb_endpoint_type(desc)) {
-       case USB_ENDPOINT_XFER_CONTROL:
-               /* don't change name */
-               break;
-       case USB_ENDPOINT_XFER_ISOC:
-               strlcat(dep->name, "-isoc", sizeof(dep->name));
-               break;
-       case USB_ENDPOINT_XFER_BULK:
-               strlcat(dep->name, "-bulk", sizeof(dep->name));
-               break;
-       case USB_ENDPOINT_XFER_INT:
-               strlcat(dep->name, "-int", sizeof(dep->name));
-               break;
-       default:
-               dev_err(dwc->dev, "invalid endpoint transfer type\n");
-       }
-
        return 0;
 }
 
@@ -680,10 +662,6 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
        dep->type = 0;
        dep->flags = 0;
 
-       snprintf(dep->name, sizeof(dep->name), "ep%d%s",
-                       dep->number >> 1,
-                       (dep->number & 1) ? "in" : "out");
-
        return 0;
 }