summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc2/drd.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-28 07:30:32 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-28 07:30:32 +0100
commit085686fb8491a7cbf6a7260d5b9d4169a041c340 (patch)
tree6b35dea52e658376f67d0a4e0cb511e0589602ea /drivers/usb/dwc2/drd.c
parent2be483f12ea34b43826f70c60f0924a7bda991bd (diff)
parent7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3 (diff)
downloadlinux-085686fb8491a7cbf6a7260d5b9d4169a041c340.tar.bz2
Merge 5.17-rc6 into char-misc-next
We need the char-misc fixes in here. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2/drd.c')
-rw-r--r--drivers/usb/dwc2/drd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/drd.c b/drivers/usb/dwc2/drd.c
index 1b39c4776369..d8d6493bc457 100644
--- a/drivers/usb/dwc2/drd.c
+++ b/drivers/usb/dwc2/drd.c
@@ -130,8 +130,10 @@ static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role)
already = dwc2_ovr_avalid(hsotg, true);
} else if (role == USB_ROLE_DEVICE) {
already = dwc2_ovr_bvalid(hsotg, true);
- /* This clear DCTL.SFTDISCON bit */
- dwc2_hsotg_core_connect(hsotg);
+ if (dwc2_is_device_enabled(hsotg)) {
+ /* This clear DCTL.SFTDISCON bit */
+ dwc2_hsotg_core_connect(hsotg);
+ }
} else {
if (dwc2_is_device_mode(hsotg)) {
if (!dwc2_ovr_bvalid(hsotg, false))