[PATCH] usb: cdns3: continue probe even when USB PHY device does not exist

Siddharth Vadapalli s-vadapalli at ti.com
Tue Jul 2 14:07:24 CEST 2024


Prior to commit cd295286c786 ("usb: cdns3: avoid error messages if phys
don't exist"), cdns3_probe() errors out only on failing to initialize the
USB2/USB3 PHY. However, since commit cd295286c786, absence of the PHY
device is also treated as an error, resulting in a regression.

Extend commit cd295286c786 to treat -ENODEV as an acceptable return value
of generic_phy_get_by_name() and continue device probe as was the case
prior to the commit.

Fixes: cd295286c786 ("usb: cdns3: avoid error messages if phys don't exist")
Signed-off-by: Siddharth Vadapalli <s-vadapalli at ti.com>
---

Hello,

This patch is based on commit
b4cbd1a257 Merge tag 'u-boot-amlogic-20240701' of https://source.denx.de/u-boot/custodians/u-boot-amlogic into next
of the next branch of U-Boot.

Regards,
Siddharth.

 drivers/usb/cdns3/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index b4e931646b..5b3e32953e 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -338,7 +338,7 @@ static int cdns3_probe(struct cdns3 *cdns)
 			dev_err(dev, "USB2 PHY init failed: %d\n", ret);
 			return ret;
 		}
-	} else if (ret != -ENOENT && ret != -ENODATA) {
+	} else if (ret != -ENOENT && ret != -ENODATA && ret != -ENODEV) {
 		dev_err(dev, "Couldn't get USB2 PHY:  %d\n", ret);
 		return ret;
 	}
@@ -350,7 +350,7 @@ static int cdns3_probe(struct cdns3 *cdns)
 			dev_err(dev, "USB3 PHY init failed: %d\n", ret);
 			return ret;
 		}
-	} else if (ret != -ENOENT && ret != -ENODATA) {
+	} else if (ret != -ENOENT && ret != -ENODATA && ret != -ENODEV) {
 		dev_err(dev, "Couldn't get USB3 PHY:  %d\n", ret);
 		return ret;
 	}
-- 
2.40.1



More information about the U-Boot mailing list