mm: get rid of radix tree gfp mask for pagecache_get_page
[cascardo/linux.git] / drivers / usb / dwc3 / host.c
index dcb8ca0..12bfd3c 100644 (file)
@@ -29,8 +29,7 @@ int dwc3_host_init(struct dwc3 *dwc)
        xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO);
        if (!xhci) {
                dev_err(dwc->dev, "couldn't allocate xHCI device\n");
-               ret = -ENOMEM;
-               goto err0;
+               return -ENOMEM;
        }
 
        dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask);
@@ -60,22 +59,33 @@ int dwc3_host_init(struct dwc3 *dwc)
                goto err1;
        }
 
+       phy_create_lookup(dwc->usb2_generic_phy, "usb2-phy",
+                         dev_name(&xhci->dev));
+       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 err1;
+               goto err2;
        }
 
        return 0;
-
+err2:
+       phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
+                         dev_name(&xhci->dev));
+       phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
+                         dev_name(&xhci->dev));
 err1:
        platform_device_put(xhci);
-
-err0:
        return ret;
 }
 
 void dwc3_host_exit(struct dwc3 *dwc)
 {
+       phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
+                         dev_name(&dwc->xhci->dev));
+       phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
+                         dev_name(&dwc->xhci->dev));
        platform_device_unregister(dwc->xhci);
 }