Skip to content

Commit 8dc7623

Browse files
Roger Quadrosgregkh
authored andcommitted
usb: ehci-omap: Fix deferred probe for phy handling
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: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Roger Quadros <rogerq@ti.com> Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c3788cd commit 8dc7623

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/usb/host/ehci-omap.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
159159
/* get the PHY device */
160160
phy = devm_usb_get_phy_by_phandle(dev, "phys", i);
161161
if (IS_ERR(phy)) {
162-
/* Don't bail out if PHY is not absolutely necessary */
163-
if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY)
162+
ret = PTR_ERR(phy);
163+
if (ret == -ENODEV) { /* no PHY */
164+
phy = NULL;
164165
continue;
166+
}
165167

166-
ret = PTR_ERR(phy);
167168
if (ret != -EPROBE_DEFER)
168169
dev_err(dev, "Can't get PHY for port %d: %d\n",
169170
i, ret);

0 commit comments

Comments
 (0)