Commit f3bcfc7e authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Felipe Balbi

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: default avatarBryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 47d3946e
...@@ -2006,11 +2006,13 @@ static const struct usb_gadget_ops dwc3_gadget_ops = { ...@@ -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; struct dwc3_ep *dep;
u8 epnum; u8 epnum;
INIT_LIST_HEAD(&dwc->gadget.ep_list);
for (epnum = 0; epnum < num; epnum++) { for (epnum = 0; epnum < num; epnum++) {
bool direction = epnum & 1; bool direction = epnum & 1;
...@@ -2112,13 +2114,6 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, u8 num) ...@@ -2112,13 +2114,6 @@ static int dwc3_gadget_init_hw_endpoints(struct dwc3 *dwc, u8 num)
return 0; 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) static void dwc3_gadget_free_endpoints(struct dwc3 *dwc)
{ {
struct dwc3_ep *dep; struct dwc3_ep *dep;
...@@ -3226,7 +3221,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) ...@@ -3226,7 +3221,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
* sure we're starting from a well known location. * 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) if (ret)
goto err6; goto err6;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment