]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
usb: dwc2: Fix build in periphal-only mode
authorPhil Elwell <phil@raspberrypi.com>
Tue, 8 Jun 2021 12:00:49 +0000 (13:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jun 2021 11:24:06 +0000 (13:24 +0200)
In branches to which 24d209dba5a3 ("usb: dwc2: Fix hibernation between
host and device modes.") 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.")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/core_intr.c

index af26a8a20e0bcbeb390c779fc01ba903dbb0ec8c..5919ecb7d4b76e953743c743f14cad519da9ee46 100644 (file)
@@ -700,7 +700,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;