mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-29 18:41:30 +00:00
usb: host: ohci-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
4b3928a08f
commit
2080d023d9
1 changed files with 6 additions and 5 deletions
|
@ -91,12 +91,13 @@ static int ohci_usb_probe(struct udevice *dev)
|
|||
error("failed to get usb phy\n");
|
||||
goto reset_err;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
err = generic_phy_init(&priv->phy);
|
||||
if (err) {
|
||||
error("failed to init usb phy\n");
|
||||
goto reset_err;
|
||||
err = generic_phy_init(&priv->phy);
|
||||
if (err) {
|
||||
error("failed to init usb phy\n");
|
||||
goto reset_err;
|
||||
}
|
||||
}
|
||||
|
||||
err = ohci_register(dev, regs);
|
||||
|
|
Loading…
Add table
Reference in a new issue