This patch causes that XHCI device is not added automatically in
dwc3_host_init() if we run in OTG mode. OTG handling code registers
XHCI device when USB host cable is detected.

Signed-off-by: Robert Baldyga <[email protected]>
---
 drivers/usb/dwc3/host.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index c679f63..4b07f13 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -62,10 +62,12 @@ int dwc3_host_init(struct dwc3 *dwc)
        phy_create_lookup(dwc->usb3_generic_phy, "usb3-phy",
                          dev_name(&xhci->dev));
 
-       ret = platform_device_add(xhci);
-       if (ret) {
-               dev_err(dwc->dev, "failed to register xHCI device\n");
-               goto err2;
+       if (!dwc->dotg) {
+               ret = platform_device_add(xhci);
+               if (ret) {
+                       dev_err(dwc->dev, "failed to register xHCI device\n");
+                       goto err2;
+               }
        }
 
        return 0;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to