[RFC linus/master 3/4] dwc2: wait for usb phy while probing

Alexander Aring alex.aring at gmail.com
Sat Oct 24 05:20:43 PDT 2015


This patch adds support to return -EPROBE_DEFER if devm_phy_get reports
it. If devm_phy_get returns -EPROBE_DEFER it could be that there is some
usb phy but it's not probed before. Other return values should indicate
a looking for an "old style USB PHY".

Cc: John Youn <johnyoun at synopsys.com>
Signed-off-by: Alexander Aring <alex.aring at gmail.com>
---
 drivers/usb/dwc2/platform.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 9093530..9d1efdf 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -228,6 +228,9 @@ static int dwc2_driver_probe(struct platform_device *dev)
 	 */
 	phy = devm_phy_get(&dev->dev, "usb2-phy");
 	if (IS_ERR(phy)) {
+		if (phy == ERR_PTR(-EPROBE_DEFER))
+			return -EPROBE_DEFER;
+
 		hsotg->phy = NULL;
 		uphy = devm_usb_get_phy(&dev->dev, USB_PHY_TYPE_USB2);
 		if (IS_ERR(uphy))
-- 
2.6.1




More information about the linux-rpi-kernel mailing list