usb_get_phy(9)
π usb_get_phy(9) π
okay so welcome to the Kernel API Manual bestie, this is the page for usb_get_phy(9) and we're gonna get you so comfy with it π«Ά
β¨ NAME β¨
usb_get_phy β find the USB PHY π
β¨ SYNOPSIS β¨
struct usb_phy * usb_get_phy (enum usb_phy_type type );
β¨ ARGUMENTS β¨
typeβ the type of the phy that the controller requires. that's the whole vibe check right there, you tell it what kind you need and it goes looking π
β¨ DESCRIPTION β¨
okay so here's the tea β β this one returns the phy driver, but only after getting a refcount to it. yes, refcount. she's counting her references, as she should π
and if there's no such phy? you get -ENODEV back. no phy, no problem, just an error code, don't take it personally π literally just means it wasn't there.
β οΈ real talk though: the caller is responsible for calling usb_put_phy to release that count. that refcount is yours now. you asked for it, you clean it up. no cap, don't just leave it hanging π
this whole thing is for use by USB host and peripheral drivers β that's the crowd this is for, iykyk πΈ
β¨ SEE ALSO β¨
- Kernel file
./drivers/usb/phy/phy.cβ go read the source bestie, it's all in there π 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)devm_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)
and that's the page!! π this lil cutie lives over in ./drivers/usb/phy and she's dated October 2026 β iconic, timeless, main character energy fr fr. mwah, go release your refcounts ππ
π¦ 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