summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/core.c
diff options
context:
space:
mode:
authorRoger Quadros <rogerq@ti.com>2018-02-27 12:54:37 +0200
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-13 10:47:51 +0200
commitdaaecc6541d014dca073473ec8a4120c0babbeb4 (patch)
tree98dfcd2b88211aab6ecf1b43d4192529611694f9 /drivers/usb/dwc3/core.c
parent4cff75c7fe3dc86f374ec37e028750a62723dc2e (diff)
usb: dwc3: prevent setting PRTCAP to OTG from debugfs
We don't support PRTCAP == OTG yet, so prevent user from setting it via debugfs. Fixes: 41ce1456e1db ("usb: dwc3: core: make dwc3_set_mode() work properly") Cc: <stable@vger.kernel.org> # v4.12+ Signed-off-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r--drivers/usb/dwc3/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index f1d838a4acd6..b014c87a7319 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -119,6 +119,9 @@ static void __dwc3_set_mode(struct work_struct *work)
if (dwc->dr_mode != USB_DR_MODE_OTG)
return;
+ if (dwc->desired_dr_role == DWC3_GCTL_PRTCAP_OTG)
+ return;
+
switch (dwc->current_dr_role) {
case DWC3_GCTL_PRTCAP_HOST:
dwc3_host_exit(dwc);