Allwinner EHCI: Do not fail if we cannot get a phy
If we cannot get a phy, do not detach the driver, some boards have phy always enabled and not exposed. While here do not release the clocks if we fails as we release them in a10_ehci_detach. Tested-on: OrangePi-One
This commit is contained in:
parent
93c3eab50c
commit
8460de6783
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=321172
@ -226,15 +226,12 @@ a10_ehci_attach(device_t self)
|
||||
}
|
||||
|
||||
/* Enable USB PHY */
|
||||
err = phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy);
|
||||
if (err != 0) {
|
||||
device_printf(self, "Could not get phy\n");
|
||||
goto error;
|
||||
}
|
||||
err = phy_enable(self, aw_sc->phy);
|
||||
if (err != 0) {
|
||||
device_printf(self, "Could not enable phy\n");
|
||||
goto error;
|
||||
if (phy_get_by_ofw_name(self, 0, "usb", &aw_sc->phy) == 0) {
|
||||
err = phy_enable(self, aw_sc->phy);
|
||||
if (err != 0) {
|
||||
device_printf(self, "Could not enable phy\n");
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
/* Enable passby */
|
||||
@ -263,10 +260,6 @@ a10_ehci_attach(device_t self)
|
||||
return (0);
|
||||
|
||||
error:
|
||||
if (aw_sc->clk != NULL) {
|
||||
clk_disable(aw_sc->clk);
|
||||
clk_release(aw_sc->clk);
|
||||
}
|
||||
a10_ehci_detach(self);
|
||||
return (ENXIO);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user