From: Marek Vasut Date: Tue, 7 Jan 2025 22:56:07 +0000 (+0100) Subject: usb: ehci-mx5: Use regulator_set_enable_if_allowed X-Git-Tag: v2025.04-rc1~64^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b20c51bc45c758e689218e2da73a50f19a5240d8;p=pandora-u-boot.git usb: ehci-mx5: Use regulator_set_enable_if_allowed With the commit 4fcba5d556b4 ("regulator: implement basic reference counter") the return value of regulator_set_enable may be EALREADY or EBUSY for fixed/gpio regulators. Change to use the more relaxed regulator_set_enable_if_allowed to continue if regulator already was enabled or disabled. Based on 335799b7252a ("usb: dwc2: Use regulator_set_enable_if_allowed") Signed-off-by: Marek Vasut Reviewed-by: Fabio Estevam Reviewed-by: Mattijs Korpershoek --- diff --git a/drivers/usb/host/ehci-mx5.c b/drivers/usb/host/ehci-mx5.c index d8f521befe1..1392d29bc13 100644 --- a/drivers/usb/host/ehci-mx5.c +++ b/drivers/usb/host/ehci-mx5.c @@ -287,9 +287,9 @@ static int ehci_usb_probe(struct udevice *dev) debug("%s: No vbus supply\n", dev->name); if (!ret && priv->vbus_supply) { - ret = regulator_set_enable(priv->vbus_supply, - (type == USB_INIT_DEVICE) ? - false : true); + ret = regulator_set_enable_if_allowed(priv->vbus_supply, + (type == USB_INIT_DEVICE) ? + false : true); if (ret) { puts("Error enabling VBUS supply\n"); return ret;