usb: dwc3: gadget: Avoid get frame in runtime suspended state

If dwc gadget is already in runtime suspended state, it should
not access the dwc3 register to get the frame number.

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: I6107f8290eff68126198bcccc0561de7d480c221
This commit is contained in:
William Wu
2025-01-24 10:16:24 +08:00
committed by Tao Huang
parent bac4740826
commit fd91f03517

View File

@@ -2446,6 +2446,9 @@ static int dwc3_gadget_get_frame(struct usb_gadget *g)
{
struct dwc3 *dwc = gadget_to_dwc(g);
if (pm_runtime_suspended(dwc->dev))
return 0;
return __dwc3_gadget_get_frame(dwc);
}