diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 48e27d4c6f29..1cf76b17463a 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -3752,10 +3752,8 @@ skip_update: dwc->maximum_speed, dwc->max_hw_supp_speed, mdwc->override_usb_speed); if (mdwc->override_usb_speed && - mdwc->override_usb_speed <= dwc->maximum_speed) { + mdwc->override_usb_speed <= dwc->maximum_speed) dwc->maximum_speed = mdwc->override_usb_speed; - dwc->gadget.max_speed = dwc->maximum_speed; - } dbg_event(0xFF, "speed", dwc->maximum_speed); diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 0f271d6e080f..e053d666a387 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -4431,7 +4431,7 @@ int dwc3_gadget_init(struct dwc3 *dwc) dev_info(dwc->dev, "changing max_speed on rev %08x\n", dwc->revision); - dwc->gadget.max_speed = dwc->maximum_speed; + dwc->gadget.max_speed = dwc->max_hw_supp_speed; /* * REVISIT: Here we should clear all pending IRQs to be