Skip to content

Commit

Permalink
usb: dwc2: Fix build in periphal-only mode
Browse files Browse the repository at this point in the history
The bus_suspended member of struct dwc2_hsotg is only present in builds
that support host-mode.

See: #4368

Fixes: 62bb46f ("usb: dwc2: Fix hibernation between host and device modes.")
Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell authored and popcornmix committed Jun 8, 2021
1 parent 3a0e9b3 commit 3d8948d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/usb/dwc2/core_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,11 @@ static inline void dwc_handle_gpwrdn_disc_det(struct dwc2_hsotg *hsotg,
dwc2_writel(hsotg, gpwrdn_tmp, GPWRDN);

hsotg->hibernated = 0;

#if IS_ENABLED(CONFIG_USB_DWC2_HOST) || \
IS_ENABLED(CONFIG_USB_DWC2_DUAL_ROLE)
hsotg->bus_suspended = 0;
#endif

if (gpwrdn & GPWRDN_IDSTS) {
hsotg->op_state = OTG_STATE_B_PERIPHERAL;
Expand Down

0 comments on commit 3d8948d

Please sign in to comment.