phylink_destroy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so this one's from the kernel API manual, section 9 (that's the kernel-functions girlies, iykyk) and honestly? it's giving "short and iconic." let's get into it ✨


✨ NAME ✨

phylink_destroy β€” cleanup and destroy the phylink instance. yes bestie, both. she cleans up AND she destroys. multi-hyphenate πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void phylink_destroy (struct phylink *pl );

so it returns nothing (void, she gives nothing back, queen behavior) and takes exactly one arg. no cap.


🌸 ARGUMENTS 🌸

  • pl β€” a pointer to a struct phylink returned from phylink_create. like, it has to be one you actually got from phylink_create, okay? not just some random pointer you found lying around. πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

so what this does is it destroys a phylink instance. periodt. that's the whole vibe.

but here's the part you actually need to remember: any PHY that has been attached must have been cleaned up via phylink_disconnect_phy prior to calling this function. like, before. not after. not "eh, close enough." before. if you skip that step you're gonna have a bad time 😭


⚠️ NOTE ⚠️

the rtnl lock must not be held when calling this function.

like, at all. not even a little. put it down first bestie 🫢 holding it is a no-no, fr fr.


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, in order, no one left out πŸ’œ


and that's the whole page, bestie! πŸŽ€ sourced straight from ./drivers/net/phy, dated October 2026 β€” yes, the future. she's ahead of her time πŸ’« stay safe, disconnect your PHY first, and don't hold that rtnl lock. mwah! πŸ«ΆπŸ’–

πŸ“¦ where this page comes from