[PATCH] usb: phy: generic: request the vbus supply only when it is described

From: hsyysy

Date: Mon Oct 26 2026 - 10:53:15 EST


From: Yang Siyuan <hsyysy@xxxxxxx>

usb_phy_gen_create_phy() unconditionally asks for an exclusive "vbus"
regulator. The legacy usb_phy_generic platform device registered by USB
glue drivers (e.g. sunxi MUSB) has no firmware node, so the lookup ends
up in the dummy-regulator path and the regulator core warns:

usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for
exclusive requests (id=vbus)

Only issue the request when the device firmware actually describes a
vbus-supply, and keep treating -ENODEV as "not present".

Signed-off-by: Yang Siyuan <hsyysy@xxxxxxx>
---
drivers/usb/phy/phy-generic.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index de26b3023..24b7ba536 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -238,7 +238,17 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)
return dev_err_probe(dev, PTR_ERR(nop->vcc),
"could not get vcc regulator\n");

- nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
+ /*
+ * vbus is an optional supply that only exists when the firmware
+ * describes it. The legacy usb_phy_generic devices registered by USB
+ * glue drivers have no firmware node, and requesting an exclusive
+ * dummy supply only makes the regulator core warn.
+ */
+ if (device_property_present(dev, "vbus-supply"))
+ nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
+ else
+ nop->vbus_draw = NULL;
+
if (PTR_ERR(nop->vbus_draw) == -ENODEV)
nop->vbus_draw = NULL;
if (IS_ERR(nop->vbus_draw))
base-commit: 091b06388b117fefdcb63336ac09956a4914b961
--
2.56.0