return 0;
}
- ret = regulator_set_enable(priv->vbus_supply, true);
- if (ret) {
+ ret = regulator_set_enable_if_allowed(priv->vbus_supply, true);
+ if (ret && ret != -ENOSYS) {
dev_err(dev, "Error enabling vbus supply\n");
return ret;
}
struct dwc2_priv *priv = dev_get_priv(dev);
int ret;
- if (priv->vbus_supply) {
- ret = regulator_set_enable(priv->vbus_supply, false);
- if (ret) {
- dev_err(dev, "Error disabling vbus supply\n");
- return ret;
- }
+ ret = regulator_set_enable_if_allowed(priv->vbus_supply, false);
+ if (ret && ret != -ENOSYS) {
+ dev_err(dev, "Error disabling vbus supply\n");
+ return ret;
}
return 0;