phy_of_parse_port(9)
π phy_of_parse_port(9) β the kernel manual, but make it make sense β¨
okay so bestie, welcome to phy_of_parse_port from the Kernel API Manual, i.e. the (9) section, which is lowkey the "kernel internals" shelf of the library. this one's a little constructor function and it's honestly so straightforward it ate. let me walk you through it π«Ά
πΈ NAME πΈ
phy_of_parse_port β literally just: create a phy_port from a firmware representation. that's the whole vibe. you hand it firmware data, it hands you back a port. iconic behavior, no notes π
β¨ SYNOPSIS β¨
struct phy_port * phy_of_parse_port (struct device_node *dn );
yes that's the whole signature, she's short and she knows it π
π ARGUMENTS π
dnβ thedevice_noderepresentation of the port, and it's supposed to be following theethernet-connector.yamlbinding. so like, if your firmware node didn't read the assignment, that's on you bestie π
π₯ RETURN π₯
it gives you back a newly allocated and initialized phy_port pointer. slay. but β and this is the important part, don't skip it β it can also return an ERR_PTR. so fr fr, check that pointer before you go dereferencing it, because an ERR_PTR is not a port, it's a little "nope" wrapped in pointer clothing π
π¦ SEE ALSO π¦
the kernel file ./drivers/net/phy/phy_port.c plus the whole friend group:
phy_port_alloc(9)phy_port_destroy(9)phy_port_update_supported(9)phy_port_filter_supported(9)phy_port_restrict_mediums(9)phy_port_get_type(9)
like, go read those too, they're all part of the same lore iykyk π
β little recap because i love you: parser in,phy_portout, and always vibes-check forERR_PTRbefore using it. no cap.
this page lives over in ./drivers/net/phy, and it's dated October 2026 β that's the source/version and date energy right there. mwah, bye 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