devm_phy_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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