Skip to contentSkip to conversation

usb: dwc2: Fix build in periphal-only mode

PATCH In review Phil Elwell 2 participants 2 messages Jun 8, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc2: Fix build in periphal-only mode

In branches to which [1] has been back-ported, the bus_suspended member of struct dwc2_hsotg is only present in builds that support host-mode. To avoid having to pull in several more non-Fix commits in order to get it to compile, wrap the usage of the member in a macro conditional.

Fixes 24d209dba5a3 ("usb: dwc2: Fix hibernation between host and device modes.")

[1] 24d209dba5a3 ("usb: dwc2: Fix hibernation between host and device modes.")

---
 drivers/usb/dwc2/core_intr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/dwc2/core_intr.c +4 -0
index a5ab03808da6..03d0c034cf57 100644
@@ -725,7 +725,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;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 11 lines · Phil Elwell

In branches to which [1] has been back-ported, the bus_suspended member of struct dwc2_hsotg is only present in builds that support host-mode. To avoid having to pull in several more non-Fix commits in order to get it to compile, wrap the usage of the member in a macro conditional.

Fixes 24d209dba5a3 ("usb: dwc2: Fix hibernation between host and device modes.")

[1] 24d209dba5a3 ("usb: dwc2: Fix hibernation between host and device modes.")

---
 drivers/usb/dwc2/core_intr.c | 4 ++++
 1 file changed, 4 insertions(+)

Now queued up everywhere, thanks.

greg k-h