From: Neil Armstrong <narmstrong@baylibre.com>
Date: Wed, 5 May 2021 08:38:57 +0000 (+0200)
Subject: usb: dwc3-meson-g12a: skip phy on -ENODATA aswell
X-Git-Tag: v2025.01-rc5-pxa1908~1879^2~2
X-Git-Url: http://git.dujemihanovic.xyz/img/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/html/index.html?a=commitdiff_plain;h=60e531fabfaa6b844fa263279f752e868e6d555c;p=u-boot.git

usb: dwc3-meson-g12a: skip phy on -ENODATA aswell

If the PHY isn't specified in the DT, -ENODATA means it should be skipped,
handle it like -ENOENT.

With that, devices without USB3 supported can have USB working (Odroid-HC4).

Fixes: adb049abf7 ("usb: dwc3: Add Meson G12A USB Glue")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---

diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index bd8bf227c8..90418ddc1d 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -298,7 +298,7 @@ static int dwc3_meson_g12a_get_phys(struct dwc3_meson_g12a *priv)
 	for (i = 0 ; i < PHY_COUNT ; ++i) {
 		ret = generic_phy_get_by_name(priv->dev, phy_names[i],
 					      &priv->phys[i]);
-		if (ret == -ENOENT)
+		if (ret == -ENOENT || ret == -ENODATA)
 			continue;
 
 		if (ret)