__phy_modify_changed(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __phy_modify_changed(9) β€” Kernel API Manual, but make it make sense πŸ’–

okay bestie, sit down, because today we're reading a page from the Kernel API Manual and honestly? she's short but she's iconic. this is __phy_modify_changed, and yes the double underscore is doing main character energy, it's part of the name, don't touch it πŸ’…


✨ NAME ✨

__phy_modify_changed β€” the convenience function for modifying a PHY register πŸŽ€

like, she's the girl who does one job and does it well. no cap.


🌸 SYNOPSIS 🌸

int __phy_modify_changed (struct phy_device *phydev , u32 regnum , u16
mask , u16 set );

that's the whole signature, character for character, go off πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • phydev β€” a pointer to a struct phy_device 🫢 (your PHY, your bestie, the whole reason we're here)
  • regnum β€” register number πŸ“ literally just which register we're messing with
  • mask β€” bit mask of bits to clear 🧹 the ones getting yeeted
  • set β€” bit mask of bits to set ⭐ the ones getting their moment

πŸ’€ DESCRIPTION πŸ’€

so here's the thing: she's an unlocked helper function, which means the locking is not her problem, she said not today 😭 but what she does do is let a PHY register be modified, and the math is literally this:

new register value = (old register value & ~mask) | set

read it slowly bestie, it slaps: take the old value, AND it with ~mask so everything in mask gets wiped, then OR in set so those bits go up. clear then set. that's the whole vibe check 🧚

and the returns? listen:

  • negative errno β€” something went wrong 😭
  • 0 β€” there was no change
  • 1 β€” in case of change πŸŽ‰

yes, zero means "nothing happened" and one means "we moved", do not mix them up i'm begging πŸ™ˆ


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./include/linux/phy.h

okay this list is long but she ate and we're listing every single one, no skipping, periodt πŸ”₯

like i said. every. single. one. πŸ’…βœ¨


ngl bestie, quick reminder: this page lives in the kernel API docs, so if the kernel changes and the docs say otherwise, the kernel wins. always. πŸ˜­πŸ™ˆ

🌈 and that's the whole page!! sourced from ./include/linux, dated October 2026, filed under the manual as __phy_modify_changed(9) β€” mwah, go read a register, ily, bye πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from