dwc3: host: don't add xhci device only if in OTG mode
authorRobert Baldyga <r.baldyga@samsung.com>
Mon, 23 Feb 2015 11:32:19 +0000 (12:32 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 13 Apr 2015 10:44:42 +0000 (12:44 +0200)
OTG handling code adds xhci device automaticaly when USB host cable
is detected.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
drivers/usb/dwc3/host.c

index c679f63783aec8c1a0fe4e43bef80546a55abf44..4b07f13889e9603b9e1a90f74621ec095ae58734 100644 (file)
@@ -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;