devm_phy_create(9)
π NAME
devm_phy_create β bestie, this is the one that creates a new phy β¨ (yes, lowercase phy, that's how the kernel spells it, we don't argue with the kernel)
This page lives in the Kernel API Manual, section 9, and it's gonna walk you through it, no cap π«Ά
πΈ SYNOPSIS
struct phy * devm_phy_create (struct device *dev , struct device_node *node , const struct phy_ops *ops );
That's the whole vibe: you hand it three things, you get a struct phy * back. Iconic behavior honestly π₯
π ARGUMENTS
devβ the device that is creating the new phy. Like, the parent energy here. This is who's doing the creating πnodeβ the device node of the phy. Point it at the right node and we're so good πΈopsβ function pointers for performing phy operations. The whole personality of your phy lives in here, fr fr π
β¨ DESCRIPTION
Okay so here's what actually happens π
It creates a new PHY device and adds it to the PHY class. Two things in one move, we love efficiency π
While it's at that, it also associates the device with the phy using devres β so the resource management is basically handled for you, which is the whole point of the devm_ prefix, iykyk π§
And on driver detach? The release function is invoked on the devres data, and then the devres data is freed. Cleanup handles itself. Main character resource management πβ¨
Note bestie: this is the managed version of creating a phy. The devm_ machinery is doing the teardown work for you on detach, so don't go freeing things twice π
π¦ SEE ALSO
Kernel file ./drivers/phy/phy-core.c β that's the source of truth, go read it if you want the lore π
And the whole friend group, all in section 9:
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)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)
Okay that's the page!! π This one ships out of the ./drivers/phy corner of the kernel tree, October 2026 edition, and it's the devm_phy_create(9) page of the Kernel API Manual. Go forth and create phy devices responsibly, bestie ππ¦β¨
π¦ 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