Commit 1cfc35d0 authored by Roger Quadros's avatar Roger Quadros Committed by Greg Kroah-Hartman

usb: ehci-omap: Fix deferred probe for phy handling

[ Upstream commit 8dc7623b ]

PHY model is being used on omap5 platforms even if port mode
is not OMAP_EHCI_PORT_MODE_PHY. So don't guess if PHY is required
or not based on PHY mode.

If PHY is provided in device tree, it must be required. So, if
devm_usb_get_phy_by_phandle() gives us an error code other
than -ENODEV (no PHY) then error out.

This fixes USB Ethernet on omap5-uevm if PHY happens to
probe after EHCI thus causing a -EPROBE_DEFER.

Cc: Johan Hovold <johan@kernel.org>
Cc: Ladislav Michl <ladis@linux-mips.org>
Reported-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
Tested-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 272ff3bb
...@@ -159,11 +159,12 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev) ...@@ -159,11 +159,12 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
/* get the PHY device */ /* get the PHY device */
phy = devm_usb_get_phy_by_phandle(dev, "phys", i); phy = devm_usb_get_phy_by_phandle(dev, "phys", i);
if (IS_ERR(phy)) { if (IS_ERR(phy)) {
/* Don't bail out if PHY is not absolutely necessary */ ret = PTR_ERR(phy);
if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY) if (ret == -ENODEV) { /* no PHY */
phy = NULL;
continue; continue;
}
ret = PTR_ERR(phy);
if (ret != -EPROBE_DEFER) if (ret != -EPROBE_DEFER)
dev_err(dev, "Can't get PHY for port %d: %d\n", dev_err(dev, "Can't get PHY for port %d: %d\n",
i, ret); i, ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment