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

Commit b7906ffb authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "dwc3: gadget: Fix dr_mode check with USB device mode APIs"

parents d0e6ace9 998aead3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2124,7 +2124,7 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
	is_on = !!is_on;
	dwc->softconnect = is_on;

	if (((dwc->dr_mode == USB_DR_MODE_OTG) && !dwc->vbus_active)
	if (((dwc->dr_mode > USB_DR_MODE_HOST) && !dwc->vbus_active)
			|| !dwc->gadget_driver) {
		/*
		 * Need to wait for vbus_session(on) from otg driver or to
@@ -2264,7 +2264,7 @@ static int dwc3_gadget_vbus_session(struct usb_gadget *_gadget, int is_active)
	unsigned long flags;
	int ret = 0;

	if (dwc->dr_mode != USB_DR_MODE_OTG)
	if (dwc->dr_mode <= USB_DR_MODE_HOST)
		return -EPERM;

	is_active = !!is_active;