diff options
| author | Jan Kiszka <jan.kiszka@siemens.com> | 2024-08-08 10:51:33 +0200 | 
|---|---|---|
| committer | Marek Vasut <marex@denx.de> | 2024-10-11 05:11:06 +0200 | 
| commit | c69ba5a4fed62463fb137eef8ed1fdc1aba2ff1f (patch) | |
| tree | ed94a4010f85a7cecbdb19e7daa6030f954ea9f2 | |
| parent | a404065479be2c1fe1167c3c91367e8194a69d1b (diff) | |
usb: dwc3-generic: fix CONFIG_DM_REGULATOR-off case
When DM_REGULATOR is disabled, all calls will return -ENOSYS. Account
for that so that targets like the IOT2050 will work again.
Fixes: de451d5d5b6f ("usb: dwc3-generic: support external vbus regulator")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
| -rw-r--r-- | drivers/usb/dwc3/dwc3-generic.c | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c index a9ba315463c..2ab41cbae45 100644 --- a/drivers/usb/dwc3/dwc3-generic.c +++ b/drivers/usb/dwc3/dwc3-generic.c @@ -246,12 +246,12 @@ static int dwc3_generic_host_probe(struct udevice *dev)  		return rc;  	rc = device_get_supply_regulator(dev, "vbus-supply", &priv->vbus_supply); -	if (rc) +	if (rc && rc != -ENOSYS)  		debug("%s: No vbus regulator found: %d\n", dev->name, rc); -	/* Only returns an error if regulator is valid and failed to enable due to a driver issue */ +	/* Does not return an error if regulator is invalid - but does so when DM_REGULATOR is disabled */  	rc = regulator_set_enable_if_allowed(priv->vbus_supply, true); -	if (rc) +	if (rc && rc != -ENOSYS)  		return rc;  	hccr = (struct xhci_hccr *)priv->gen_priv.base; | 
