Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: ehci-orion: fix probe for !GENERIC_PHY

Commit d445913ce0ab7f ("usb: ehci-orion: add optional PHY support")
added support for optional phys, but devm_phy_optional_get returns
-ENOSYS if GENERIC_PHY is not enabled.

This causes probe failures, even when there are no phys specified:

[ 1.443365] orion-ehci f1058000.usb: init f1058000.usb fail, -38
[ 1.449403] orion-ehci: probe of f1058000.usb failed with error -38

Similar to dwc3, treat -ENOSYS as no phy.

Fixes: d445913ce0ab7f ("usb: ehci-orion: add optional PHY support")

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jonas Gorski and committed by
Greg Kroah-Hartman
db1319e1 17a364e2

+2 -1
+2 -1
drivers/usb/host/ehci-orion.c
··· 224 224 priv->phy = devm_phy_optional_get(&pdev->dev, "usb"); 225 225 if (IS_ERR(priv->phy)) { 226 226 err = PTR_ERR(priv->phy); 227 - goto err_phy_get; 227 + if (err != -ENOSYS) 228 + goto err_phy_get; 228 229 } else { 229 230 err = phy_init(priv->phy); 230 231 if (err)