devm_usb_get_phy(9)
β¨ devm_usb_get_phy π
okay so real talk, this is a page from the Kernel API Manual (yes, the kernel has lore too, and it's giving ancient tome but make it slay) and it's all about devm_usb_get_phy β the little helper that goes "bestie, I gotchu, here's your USB PHY" π¦
πΈ NAME πΈ
devm_usb_get_phy β find the USB PHY. that's it, that's the whole job, and it does it immaculately β¨
π SYNOPSIS π
struct usb_phy * devm_usb_get_phy (struct device *dev , enum
usb_phy_type type );
like, literally just hand it a device and a phy type and it comes back with a struct usb_phy *, no cap π
π« ARGUMENTS π«
devβ the device that requests this phy. it's the one doing the asking, the main character of this transaction πtypeβ the type of the phy the controller requires. the controller is picky, it knows what it wants, and this is the vibe check π«Ά
π₯ DESCRIPTION π₯
so here's the tea: it gets the phy using usb_get_phy, and then associates a device with it using devres. iconic teamwork honestly π€
and the devres part is the good part β on driver detach, the release function is invoked on the devres data, and then the devres data is freed. automatic cleanup, no leaks, we love a self-cleaning queen π§β¨
ngl this one is for use by USB host and peripheral drivers only β so if you're not one of those, this ain't your moment bestie π
π SEE ALSO π
the kernel file ./drivers/usb/phy/phy.c (go read it, it ate) plus the whole friend group:
usb_phy_notify_charger_work(9)usb_phy_get_charger_type(9)usb_phy_set_charger_current(9)usb_phy_get_charger_current(9)usb_phy_set_charger_state(9)usb_get_phy(9)devm_usb_get_phy_by_node(9)devm_usb_get_phy_by_phandle(9)usb_put_phy(9)usb_add_phy(9)usb_add_phy_dev(9)usb_remove_phy(9)usb_phy_set_event(9)
fr fr it's a whole squad and they're all serving π
okay that's the page!! sign-off time: this one lives in ./drivers/usb/phy, it's dated October 2026, and the page itself is devm_usb_get_phy(9). periodt. ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms