summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorBryan O'Donoghue <pure.logic@nexus-software.ie>2017-01-31 23:58:11 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-04-11 10:58:18 +0300
commitf3bcfc7e68f0f13903465dae8196dade17ebb364 (patch)
treeba084dd12b49f770bed997ac2bce870390685465 /drivers/usb/dwc3
parent47d3946ea220f2db43b3abc46c9e64287d625ac3 (diff)
downloadlinux-f3bcfc7e68f0f13903465dae8196dade17ebb364.tar.xz
usb: dwc3: remove dwc3_gadget_init_hw_endpoints
A previous patch in the series reduces the number of callsites of dwc3_gadget_init_hw_endpoints from two to one. This patch removes the redundant step of wrappering one function in the other, which can be done by adding a parameter to dwc3_gadget_init_endpoints and moving the linked-list initialization of dwc->gadet.ep_list. Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index fe4e0ac00f06..1a90877f8b96 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2006,11 +2006,13 @@ static const struct usb_gadget_ops dwc3_gadget_ops = {
/* -------------------------------------------------------------------------- */
-static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, u8 num)
+static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 num)
{
struct dwc3_ep *dep;
u8 epnum;
+ INIT_LIST_HEAD(&dwc->gadget.ep_list);
+
for (epnum = 0; epnum < num; epnum++) {
bool direction = epnum & 1;
@@ -2112,13 +2114,6 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, u8 num)
return 0;
}
-static int dwc3_gadget_init_endpoints(struct dwc3 *dwc)
-{
- INIT_LIST_HEAD(&dwc->gadget.ep_list);
-
- return dwc3_gadget_init_hw_endpoints(dwc, dwc->num_eps);
-}
-
static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
{
struct dwc3_ep *dep;
@@ -3226,7 +3221,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
* sure we're starting from a well known location.
*/
- ret = dwc3_gadget_init_endpoints(dwc);
+ ret = dwc3_gadget_init_endpoints(dwc, dwc->num_eps);
if (ret)
goto err6;