Skip to content

Commit f564780

Browse files
sean-anderson-secogregkh
authored andcommitted
usb: phy: generic: Get the vbus supply
commit 03e607c upstream. While support for working with a vbus was added, the regulator was never actually gotten (despite what was documented). Fix this by actually getting the supply from the device tree. Fixes: 7acc997 ("usb: phy: generic: add vbus support") Cc: stable <[email protected]> Signed-off-by: Sean Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 685edaf commit f564780

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/usb/phy/phy-generic.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,13 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)
268268
return -EPROBE_DEFER;
269269
}
270270

271+
nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
272+
if (PTR_ERR(nop->vbus_draw) == -ENODEV)
273+
nop->vbus_draw = NULL;
274+
if (IS_ERR(nop->vbus_draw))
275+
return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
276+
"could not get vbus regulator\n");
277+
271278
nop->dev = dev;
272279
nop->phy.dev = nop->dev;
273280
nop->phy.label = "nop-xceiv";

0 commit comments

Comments
 (0)