of_phy_get_and_connect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

of_phy_get_and_connect(9) β€” welcome to the Kernel API Manual, bestie 🫢. And honestly? The original NAME entry is literally just of_phy_get_and_connect - with the description left blank 😭. No cap, that's the whole vibe.


✨ SYNOPSIS ✨

struct phy_device * of_phy_get_and_connect (struct net_device *dev ,
struct device_node *np , void (*hndlr)(struct net_device *) );

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” pointer to net_device claiming the phy πŸ‘‘
  • np β€” Pointer to device tree node for the net_device claiming the phy 🌸
  • hndlr β€” Link state callback for the network device πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

  • Get phy node and connect to the phy described in the device tree 🌈

If successful, returns a pointer to the phy_device with the embedded struct device refcount incremented by one, or NULL on failure πŸ’€. The refcount must be dropped by calling phy_disconnect or phy_detach β€” like, fr fr, don't forget this part 🫢.

⚠️ Bestie, that refcount is not decorative. It must be dropped with phy_disconnect or phy_detach, periodt.

🌈 SEE ALSO 🌈

Kernel file ./drivers/net/mdio/of_mdio.c β€” and the whole crew: __of_mdiobus_register(9), of_mdio_find_device(9), of_phy_find_device(9), of_phy_connect(9) βœ¨πŸ¦‹


Signed off from ./drivers/net/mdio, dated October 2026 πŸ’œ β€” stay iconic, keep your refcounts tidy, and slay the device tree πŸŽ€

πŸ“¦ where this page comes from