devm_usb_get_phy_by_phandle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– devm_usb_get_phy_by_phandle(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's all about devm_usb_get_phy_by_phandle, and it's genuinely so useful, let me tell you everything ✨


✨ NAME ✨

devm_usb_get_phy_by_phandle β€” find the USB PHY by phandle πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct usb_phy * devm_usb_get_phy_by_phandle (struct device *dev , const
char *phandle , u8 index );

🌸 ARGUMENTS 🌸

  • dev β€” the device that's requesting this phy, like it's the one doing the asking πŸ’…
  • phandle β€” the name of the property that's holding the phy phandle value, iykyk
  • index β€” the index of the phy, yes there can be a whole lineup 🫢

πŸ”₯ DESCRIPTION πŸ”₯

So here's the vibe: this returns the phy driver that's associated with the given phandle value, after getting a refcount to it. Iconic. But also β€” it returns -ENODEV if there's no such phy, or -EPROBE_DEFER if there is a phandle to the phy but the device isn't loaded yet. Not me being dramatic, that's literally the deal 😭

While it's at it, it also associates the device with the phy using devres. And on driver detach? The release function is invoked on the devres data, then the devres data is freed. Cleanup queen behavior, honestly πŸ‘‘

For use by USB host and peripheral drivers. That's the whole audience, no gatekeeping.


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/usb/phy/phy.c plus the whole friend group:


ngl bestie, always check your return value β€” -ENODEV and -EPROBE_DEFER are two very different moods and you don't wanna mix them up πŸ™ˆ

okay that's the whole page, mwah πŸ’‹ β€” this gem lives in ./drivers/usb/phy, dated October 2026, and it's called devm_usb_get_phy_by_phandle(9) in case you forgot already. slay, go write some drivers πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from