devm_usb_get_phy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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:

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