of_phy_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« 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 β€” the device_node for 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