of_phy_get(9)
π« of_phy_get(9) β like, the whole kernel API manual vibe π«
okay so bestie, welcome to of_phy_get(9) from the Kernel API Manual β yes that's the manual name, we're fancy now π
β¨ NAME β¨
of_phy_get β lookup and obtain a reference to a phy using a device_node.
like, you hand it a node and it hands you back a phy, that's the whole thing, it's giving matchmaker energy π
πΈ SYNOPSIS πΈ
struct phy * of_phy_get (struct device_node *np , const char *con_id );
so iconic. the signature ate and left no crumbs π₯
π¦ ARGUMENTS π¦
npβ thedevice_nodefor which to get the phy. like, which phy are we talking about, this is your "who" π«Άcon_idβ the name of the phy from the device's point of view. iykyk β it's the phy's name as your device sees it, not some absolute truth β¨
π DESCRIPTION π
Okay so here's the tea β β it returns the phy driver, after getting a refcount to it. highkey important: you now hold a reference. main character responsibility.
But if there is no such phy? boom, -ENODEV. literally just -ENODEV, no phy for you, not today π
And bestie, listen β the caller is responsible for calling of_phy_put to release that count. no cap. if you don't, that refcount is never coming down and that's not the vibe. don't leave it hanging π
π SEE ALSO π
Kernel file ./drivers/phy/phy-core.c β and the whole friend group, periodt:
phy_create_lookup(9), phy_remove_lookup(9), phy_init(9), phy_exit(9), phy_power_on(9), phy_power_off(9), phy_calibrate(9), phy_notify_connect(9), phy_notify_disconnect(9), phy_notify_state(9), phy_configure(9), phy_validate(9), _of_phy_get(9), of_phy_put(9), phy_put(9), devm_phy_put(9), of_phy_simple_xlate(9), phy_get(9), devm_phy_get(9), devm_phy_optional_get(9), devm_of_phy_get(9), devm_of_phy_optional_get(9), devm_of_phy_get_by_index(9), phy_create(9), devm_phy_create(9), phy_destroy(9), devm_phy_destroy(9), __of_phy_provider_register(9), __devm_of_phy_provider_register(9), of_phy_provider_unregister(9), devm_of_phy_provider_unregister(9), phy_release(9)
and that's the whole page, slay π this little beauty lives in ./drivers/phy and is dated October 2026 β mwah, go get that refcount and remember to put it back π§π
π¦ 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