summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/dwc3/host.c')
-rw-r--r--drivers/usb/dwc3/host.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index c679f63783ae..d03678a02185 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -32,6 +32,7 @@ int dwc3_host_init(struct dwc3 *dwc)
return -ENOMEM;
}
+ arch_setup_dma_ops(&xhci->dev, 0, 0, NULL, 0);
dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask);
xhci->dev.parent = dwc->dev;
@@ -62,18 +63,9 @@ 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;
- }
-
+ /* Platform device gets added as part of state machine */
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);
return ret;
@@ -85,5 +77,6 @@ void dwc3_host_exit(struct dwc3 *dwc)
dev_name(&dwc->xhci->dev));
phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
dev_name(&dwc->xhci->dev));
- platform_device_unregister(dwc->xhci);
+ if (!dwc->is_drd)
+ platform_device_unregister(dwc->xhci);
}