1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-04 10:12:14 +02: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:
Patrice Chotard
2017-07-24 17:07:05 +02:00
committed by Marek Vasut
parent 4b3928a08f
commit 2080d023d9

View File

@@ -91,12 +91,13 @@ static int ohci_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;
}
} }
err = ohci_register(dev, regs); err = ohci_register(dev, regs);