Skip to contentSkip to conversation

usb: dwc3: Fix support for usb3-phy PHY configuration

PATCH In review Marek Vasut 2 participants 2 messages May 19, 2022 – May 20, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc3: Fix support for usb3-phy PHY configuration

The dev_read_stringlist_search() in generic_phy_get_by_name() returns -ENODATA in case of missing "phy-names", which is the case on everything except ZynqMP. Handle this -ENODATA instead of failing outright, which fixes the glue on everything else.

Fixes 142d50fbce7 ("usb: dwc3: Add support for usb3-phy PHY configuration")
Cc Michal Simek <[email protected]>
---
 drivers/usb/dwc3/dwc3-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-generic.c +1 -1
index 6e1a1d066b4..9608c5c599a 100644
@@ -468,7 +468,7 @@ static int dwc3_glue_probe(struct udevice *dev)
 		ret = generic_phy_init(&phy);
 		if (ret)
 			return ret;
-	} else if (ret != -ENOENT) {
+	} else if (ret != -ENOENT && ret != -ENODATA) {
 		debug("could not get phy (err %d)\n", ret);
 		return ret;
 	}
Signature · 1 line
2.35.1
#1 lore raw
Quoted 17 lines · Marek Vasut

The dev_read_stringlist_search() in generic_phy_get_by_name() returns -ENODATA in case of missing "phy-names", which is the case on everything except ZynqMP. Handle this -ENODATA instead of failing outright, which fixes the glue on everything else.

Fixes 142d50fbce7 ("usb: dwc3: Add support for usb3-phy PHY configuration")
Cc Michal Simek <[email protected]>
---
  drivers/usb/dwc3/dwc3-generic.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-generic.c +0 -0
index 6e1a1d066b4..9608c5c599a 100644

drivers/usb/dwc3/dwc3-generic.c static int dwc3_glue_probe(struct udevice *dev) · line 474

Quoted 8 lines
drivers/usb/dwc3/dwc3-generic.c +1 -1
@@ -468,7 +468,7 @@ static int dwc3_glue_probe(struct udevice *dev)
  		ret = generic_phy_init(&phy);
  		if (ret)
  			return ret;
-	} else if (ret != -ENOENT) {
+	} else if (ret != -ENOENT && ret != -ENODATA) {
  		debug("could not get phy (err %d)\n", ret);
  		return ret;
  	}

Is already handle by one of these in queue.

https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]

Thanks,
Michal