Re: [PATCH 2/2] usb: ehci-vf: enable the vbus supply of the port
Marek Vasut <[email protected]>
| Newsgroups | org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <[email protected]> |
On 8/19/26 4:35 PM, Mehmet Fide wrote:
[...]
> +static int ehci_usb_remove(struct udevice *dev)
> +{
> + struct ehci_vf_priv_data *priv = dev_get_priv(dev);
> +
> + if (CONFIG_IS_ENABLED(DM_REGULATOR) && priv->vbus_supply)
> + regulator_set_enable_if_allowed(priv->vbus_supply, false);
The test for DM_REGULATOR being enabled is already in
include/power/regulator.h, regulator_set_enable_if_allowed() will return
-ENOSYS if DM_REGULATOR is disabled. Your implementation has to check
for that, example:
drivers/adc/adc-uclass.c: ret =
regulator_set_enable_if_allowed(uc_pdata->vss_supply, true);
drivers/adc/adc-uclass.c- if (ret && ret != -ENOSYS) {
drivers/adc/adc-uclass.c- pr_err("%s: can't enable
vss-supply!", dev->name);
drivers/adc/adc-uclass.c- return ret;
drivers/adc/adc-uclass.c- }