Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28d1ca1b authored by Hemant Kumar's avatar Hemant Kumar
Browse files

usb: dwc3: gadget: Fix endpoint init for reserving gsi endpoint



gsi endpoint is reserved using endpoint address instead of
endpoint number. This would name other endpoints as gsi endpoint
as well.

Change-Id: I15f86b96b1a9a69e895fac5a2fe4f90fe6bb8a81
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 0a48238d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2661,6 +2661,7 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total)

	for (epnum = 0; epnum < total; epnum++) {
		int			ret;
		u8			num = epnum >> 1;

		ret = dwc3_gadget_init_endpoint(dwc, epnum);
		if (ret)
@@ -2668,11 +2669,11 @@ static int dwc3_gadget_init_endpoints(struct dwc3 *dwc, u8 total)

		dep = dwc->eps[epnum];
		/* Reserve EPs at the end for GSI */
		if (!dep->direction && dep->number >
		if (!dep->direction && num >
				out_count - NUM_GSI_OUT_EPS - 1) {
			snprintf(dep->name, sizeof(dep->name), "gsi-epout");
			dep->endpoint.ep_type = EP_TYPE_GSI;
		} else if (dep->direction && dep->number >
		} else if (dep->direction && num >
				in_count - NUM_GSI_IN_EPS - 1) {
			snprintf(dep->name, sizeof(dep->name), "gsi-epin");
			dep->endpoint.ep_type = EP_TYPE_GSI;