usb: dwc2: Fix phy_reset_work compile error for peripheral-only config
Subsystems (3)
PATCH 1/1 usb: dwc2: Fix phy_reset_work compile error for peripheral-only config
In commit a0a493835f9a ("usb: dwc2: optionally assert phy reset when waking up") I added to code that is compiled in both the host and peripheral configs but it referenced a structure member that I added to a section that was only there for host or dual-mode configs. That led to the compile error:
Quoted 1 line
Quoted 1 line
drivers/usb/dwc2/core_intr.c:448:25: error: 'structdwc2_hsotg' has no member named 'phy_reset_work'
We'll add a little helper function to schedule the work and then we can have a dummy version of that helper in peripheral-only mode.
Fixes a0a493835f9a ("usb: dwc2: optionally assert phy reset when waking up")
Reported-by kbuild test robot <[email protected]>
Signed-off-by Douglas Anderson <[email protected]>
---
drivers/usb/dwc2/core.h | 3 +++ drivers/usb/dwc2/core_intr.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/usb/dwc2/core.h +3 -0
@@ -1438,6 +1438,8 @@ int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg);int dwc2_host_enter_hibernation (struct dwc2_hsotg *hsotg);int dwc2_host_exit_hibernation (struct dwc2_hsotg *hsotg,int rem_wakeup,int reset); +static inline void dwc2_host_schedule_phy_reset (struct dwc2_hsotg *hsotg) +{schedule_work (&hsotg->phy_reset_work); }#else static inline int dwc2_hcd_get_frame_number (struct dwc2_hsotg *hsotg) {return 0 ; }
@@ -1461,6 +1463,7 @@ static inline int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg)static inline int dwc2_host_exit_hibernation (struct dwc2_hsotg *hsotg,int rem_wakeup,int reset) {return 0 ; } +static inline void dwc2_host_schedule_phy_reset (struct dwc2_hsotg *hsotg) {}#endif
drivers/usb/dwc2/core_intr.c +1 -1
@@ -445,7 +445,7 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg)* schedule it for later. */ if (hsotg->reset_phy_on_wake) -schedule_work (&hsotg->phy_reset_work); +dwc2_host_schedule_phy_reset (hsotg);mod_timer (&hsotg->wkp_timer, jiffies +msecs_to_jiffies (71 ));
Signature · 1 line
2.21.0.593.g511ec345e18-goog