phy_device_remove(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 phy_device_remove(9) β€” Kernel API Manual 🌸

okay bestie, welcome to the glow-up era of the kernel API manual πŸ’… this one's from the phy_device_remove page and it's short, sweet, and honestly iconic for it. let's get into it 🫢


✨ NAME ✨

phy_device_remove β€” take a phy device that was already registered and yeet it off the MDIO bus πŸ¦‹

like, not destroy it, just un-register it. big difference. keep reading, i promise it matters πŸ’–


✨ SYNOPSIS ✨

void phy_device_remove (struct phy_device *phydev );

no return value, returns nothing, gives you zero information back β€” it's giving void and honestly? respect πŸ™ˆ


✨ ARGUMENTS ✨

  • phydev β€” the phy_device structure you're removing. that's it. that's the whole argument. one (1) singular phy device to evict πŸŽ€

✨ DESCRIPTION ✨

okay so this is the part where you need to listen, because this is the classic gotcha 😭

This doesn't free the phy_device itself. like, at all. nope. what it actually does is merely reverse the effects of phy_device_register. that's the whole job. it undoes the registration, it does not go anywhere near freeing your memory πŸ”₯

so if you're sitting there thinking "cool, removed it, memory's handled" β€” no bestie. use phy_device_free to free the device after calling this function. after. like, this function first, then that one. in that order. periodt πŸ’€

lowkey the most important sentence on this whole page: remove β‰  free. do both, in the right order, or the vibe check will fail catastrophically 🧚

✨ SEE ALSO ✨

the source lives in the kernel file ./drivers/net/phy/phy_device.c β€” and the related-manpage section is stacked, like genuinely a whole friend group of functions πŸ‘‘


and that's the page!! short king of a manpage, but every word counts 🌈 this one's filed under ./drivers/net/phy, dated October 2026 β€” so like, future-dated but still exactly as iconic as ever πŸ’œ mwah, go free your phy devices properly πŸŽ€βœ¨

πŸ“¦ where this page comes from