mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 17:10:11 +00:00
usb: host: ehci-generic: initialize PHY only when found
Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT. Signed-off-by: Patrice Chotard <patrice.chotard@st.com> Reported-by: Patrick Delaunay <patrick.delaunay@st.com>
This commit is contained in:
parent
623b7aca1f
commit
4b3928a08f
1 changed files with 6 additions and 5 deletions
|
@ -99,13 +99,14 @@ static int ehci_usb_probe(struct udevice *dev)
|
||||||
error("failed to get usb phy\n");
|
error("failed to get usb phy\n");
|
||||||
goto reset_err;
|
goto reset_err;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
|
||||||
err = generic_phy_init(&priv->phy);
|
err = generic_phy_init(&priv->phy);
|
||||||
if (err) {
|
if (err) {
|
||||||
error("failed to init usb phy\n");
|
error("failed to init usb phy\n");
|
||||||
goto reset_err;
|
goto reset_err;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hccr = map_physmem(devfdt_get_addr(dev), 0x100, MAP_NOCACHE);
|
hccr = map_physmem(devfdt_get_addr(dev), 0x100, MAP_NOCACHE);
|
||||||
hcor = (struct ehci_hcor *)((uintptr_t)hccr +
|
hcor = (struct ehci_hcor *)((uintptr_t)hccr +
|
||||||
|
|
Loading…
Reference in a new issue