__of_phy_provider_register(9)
π
__of_phy_provider_register β Kernel API Manual, bestie edition π
Okay so real talk, the manual name up top is Kernel API Manual, and today's main character is __of_phy_provider_register(9). Buckle up, this one's giving "I register PHY providers and I do it flawlessly" energy. β¨
πΈ NAME πΈ
__of_phy_provider_register β literally just create/register a phy provider with the framework. That's it. That's the whole vibe. π¦
β¨ SYNOPSIS β¨
struct phy_provider * __of_phy_provider_register (struct device *dev ,
struct device_node *children , struct module *owner , struct phy *
(*of_xlate)(struct device *dev, const struct of_phandle_args *args) );
Four args, one return, no cap. Copy it exactly, don't get cute with the signature. π
π«Ά ARGUMENTS π«Ά
devβ thestruct deviceof the phy provider. Your provider's whole identity, honestly.childrenβ the device node that contains the children, if it's different fromdev->of_node. Only relevant when your provider doesn't nest its children directly, iykyk.ownerβ the module owner that containsof_xlate. Like, who do we blame / who gets pinned for the refcount. πof_xlateβ function pointer that obtains a phy instance from the phy provider. The little translator doing the actual work.
π₯ DESCRIPTION π₯
So it creates a struct phy_provider from dev and the of_xlate function pointer. That's the whole function, and honestly she ate. π
This is the one you use in the case of dt boot for finding the phy instance from the phy provider. No device tree, no party. π
Now here's the nuance, and listen closely bestie because this is the part people fumble:
If the PHY provider doesn't nest children directly but uses a separate child node to contain the individual children, the children parameter can be used to override the default. Queen behavior, truly.
- If
childrenisNULL, the default (dev->of_node) will be used. Easy. Cozy. No notes. π - If
childrenis non-NULL, the device node must be a child (or further descendant) ofdev->of_node.
β οΈ And if it's not? Then you get anERR_PTR-encoded-EINVALerror code returned. Not me getting a-EINVALin front of the whole group chat π Pay attention to the parentage, fr fr.
π SEE ALSO π
Kernel file ./drivers/phy/phy-core.c is the source of truth, and here's the whole extended friend group you should know about β no skips, we're listing every single one:
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_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), __devm_of_phy_provider_register(9), of_phy_provider_unregister(9), devm_of_phy_provider_unregister(9), phy_release(9)
Periodt. Go read them, they're all slay too. π§
β¨ cute little sign-off β¨
This whole page lives in ./drivers/phy, dated October 2026, and it's all about __of_phy_provider_register(9) β that's the version, that's the source, that's the vibe. Go register some providers, bestie, and remember: the children node stays inside the family tree or it's -EINVAL for you. π
π¦πΈ
π¦ 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