Skip to content

Commit f54edb5

Browse files
author
Felipe Balbi
committed
usb: dwc3: core: initialize ULPI before trying to get the PHY
If don't reorder initialization like this, we will never be able to get a reference to ULPI PHYs. Signed-off-by: Felipe Balbi <[email protected]>
1 parent e008269 commit f54edb5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/usb/dwc3/core.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ static void dwc3_core_setup_global_control(struct dwc3 *dwc)
721721
dwc3_writel(dwc->regs, DWC3_GCTL, reg);
722722
}
723723

724+
static int dwc3_core_get_phy(struct dwc3 *dwc);
725+
724726
/**
725727
* dwc3_core_init - Low-level initialization of DWC3 Core
726728
* @dwc: Pointer to our controller context structure
@@ -759,6 +761,10 @@ static int dwc3_core_init(struct dwc3 *dwc)
759761
if (ret)
760762
goto err0;
761763

764+
ret = dwc3_core_get_phy(dwc);
765+
if (ret)
766+
goto err0;
767+
762768
dwc3_core_setup_global_control(dwc);
763769
dwc3_core_num_eps(dwc);
764770

@@ -1156,10 +1162,6 @@ static int dwc3_probe(struct platform_device *pdev)
11561162
platform_set_drvdata(pdev, dwc);
11571163
dwc3_cache_hwparams(dwc);
11581164

1159-
ret = dwc3_core_get_phy(dwc);
1160-
if (ret)
1161-
goto err0;
1162-
11631165
spin_lock_init(&dwc->lock);
11641166

11651167
pm_runtime_set_active(dev);

0 commit comments

Comments
 (0)