소스 검색

USB: ehci-omap: Try to get PHY even if not in PHY mode

Even when not in PHY mode, the USB device on the port (e.g. HUB)
might need resources like RESET which can be modelled as a PHY
device. So try to get the PHY device in any case.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Roger Quadros 12 년 전
부모
커밋
a2f450ca88
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      drivers/usb/host/ehci-omap.c

+ 4 - 3
drivers/usb/host/ehci-omap.c

@@ -202,15 +202,16 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 	for (i = 0 ; i < omap->nports ; i++) {
 	for (i = 0 ; i < omap->nports ; i++) {
 		struct usb_phy *phy;
 		struct usb_phy *phy;
 
 
-		if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY)
-			continue;
-
 		/* get the PHY device */
 		/* get the PHY device */
 		if (dev->of_node)
 		if (dev->of_node)
 			phy = devm_usb_get_phy_by_phandle(dev, "phys", i);
 			phy = devm_usb_get_phy_by_phandle(dev, "phys", i);
 		else
 		else
 			phy = devm_usb_get_phy_dev(dev, i);
 			phy = devm_usb_get_phy_dev(dev, i);
 		if (IS_ERR(phy) || !phy) {
 		if (IS_ERR(phy) || !phy) {
+			/* Don't bail out if PHY is not absolutely necessary */
+			if (pdata->port_mode[i] != OMAP_EHCI_PORT_MODE_PHY)
+				continue;
+
 			ret = IS_ERR(phy) ? PTR_ERR(phy) : -ENODEV;
 			ret = IS_ERR(phy) ? PTR_ERR(phy) : -ENODEV;
 			dev_err(dev, "Can't get PHY device for port %d: %d\n",
 			dev_err(dev, "Can't get PHY device for port %d: %d\n",
 					i, ret);
 					i, ret);