[PATCH 2/2] usb: ehci-mx6: Use regulator_set_enable_if_allowed

Mattijs Korpershoek mkorpershoek at baylibre.com
Wed Jan 8 09:20:45 CET 2025


Hi Marek,

Thank you for the patch.

On mar., janv. 07, 2025 at 23:56, Marek Vasut <marex at denx.de> wrote:

> 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 <marex at denx.de>

Reviewed-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>

> ---
> Cc: Alice Guo <alice.guo at nxp.com>
> Cc: Fabio Estevam <festevam at gmail.com>
> Cc: Mathieu Othacehe <othacehe at gnu.org>
> Cc: Mattijs Korpershoek <mkorpershoek at baylibre.com>
> Cc: Peng Fan <peng.fan at nxp.com>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: u-boot at lists.denx.de
> ---
>  drivers/usb/host/ehci-mx6.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
> index a93fa5d5455..a8748cef7ad 100644
> --- a/drivers/usb/host/ehci-mx6.c
> +++ b/drivers/usb/host/ehci-mx6.c
> @@ -479,9 +479,9 @@ static int mx6_init_after_reset(struct ehci_ctrl *dev)
>  #if CONFIG_IS_ENABLED(DM_REGULATOR)
>  	if (priv->vbus_supply) {
>  		int ret;
> -		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 && ret != -ENOSYS) {
>  			printf("Error enabling VBUS supply (ret=%i)\n", ret);
>  			return ret;
> -- 
> 2.45.2


More information about the U-Boot mailing list