From: Yang Siyuan <hsyysy@163.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH RESEND] usb: phy: generic: request the vbus supply only when it is described
Date: Tue, 17 Nov 2026 17:19:56 +0800 [thread overview]
Message-ID: <20261117091956.12103-1-hsyysy@163.com> (raw)
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@163.com>
---
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
next reply other threads:[~2026-11-17 9:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 9:19 Yang Siyuan [this message]
2026-11-17 9:45 ` [PATCH v2] " Yang Siyuan
2026-11-18 11:23 ` Freimut Diener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261117091956.12103-1-hsyysy@163.com \
--to=hsyysy@163.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®