aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/core.c
diff options
context:
space:
mode:
authorIvan T. Ivanov <iivanov@mm-sol.com>2013-07-29 03:27:02 -0400
committerFelipe Balbi <balbi@ti.com>2013-07-29 08:22:37 -0400
commit2e112345c22bcdf5d246db40f0587d7d11f1dc61 (patch)
treec30da8ed4476a11c9ca0001250c7965405871b5a /drivers/usb/dwc3/core.c
parenta554aea67aaadb7f3396b2a8f940ab0b915b2a5e (diff)
usb: dwc3: core: modify IO memory resource after deferred probe completes
When deferred probe happens driver will try to ioremap multiple times and will fail. Memory resource.start variable is a global variable, modifications in this field will be accumulated on every probe. Fix this by moving the above operations after driver hold all required PHY's. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3/core.c')
-rw-r--r--drivers/usb/dwc3/core.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index dfbc1f0fc0e3..da0a4b8b33ed 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -384,21 +384,6 @@ static int dwc3_probe(struct platform_device *pdev)
384 dev_err(dev, "missing memory resource\n"); 384 dev_err(dev, "missing memory resource\n");
385 return -ENODEV; 385 return -ENODEV;
386 } 386 }
387 dwc->xhci_resources[0].start = res->start;
388 dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
389 DWC3_XHCI_REGS_END;
390 dwc->xhci_resources[0].flags = res->flags;
391 dwc->xhci_resources[0].name = res->name;
392
393 res->start += DWC3_GLOBALS_REGS_START;
394
395 /*
396 * Request memory region but exclude xHCI regs,
397 * since it will be requested by the xhci-plat driver.
398 */
399 regs = devm_ioremap_resource(dev, res);
400 if (IS_ERR(regs))
401 return PTR_ERR(regs);
402 387
403 if (node) { 388 if (node) {
404 dwc->maximum_speed = of_usb_get_maximum_speed(node); 389 dwc->maximum_speed = of_usb_get_maximum_speed(node);
@@ -452,6 +437,22 @@ static int dwc3_probe(struct platform_device *pdev)
452 return -EPROBE_DEFER; 437 return -EPROBE_DEFER;
453 } 438 }
454 439
440 dwc->xhci_resources[0].start = res->start;
441 dwc->xhci_resources[0].end = dwc->xhci_resources[0].start +
442 DWC3_XHCI_REGS_END;
443 dwc->xhci_resources[0].flags = res->flags;
444 dwc->xhci_resources[0].name = res->name;
445
446 res->start += DWC3_GLOBALS_REGS_START;
447
448 /*
449 * Request memory region but exclude xHCI regs,
450 * since it will be requested by the xhci-plat driver.
451 */
452 regs = devm_ioremap_resource(dev, res);
453 if (IS_ERR(regs))
454 return PTR_ERR(regs);
455
455 usb_phy_set_suspend(dwc->usb2_phy, 0); 456 usb_phy_set_suspend(dwc->usb2_phy, 0);
456 usb_phy_set_suspend(dwc->usb3_phy, 0); 457 usb_phy_set_suspend(dwc->usb3_phy, 0);
457 458