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

Commit f2df679b authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: dwc3: gadget: avoid while(1) in run_stop()



instead of looping forever and forcing a return if
timeout reaches zero, we can just use timeout and
loop's break condition directly.

Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent d807bdd0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1581,10 +1581,10 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)
			if (reg & DWC3_DSTS_DEVCTRLHLT)
				break;
		}
		timeout--;
	} while (--timeout);

	if (!timeout)
		return -ETIMEDOUT;
	} while (1);

	dwc3_trace(trace_dwc3_gadget, "gadget %s data soft-%s",
			dwc->gadget_driver