of_overlay_n...ier_register(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

of_overlay_n...ier_register(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ this page is literally called of_overlay_n...ier_register(9) (yes the title is giving "my name got cut off in the group chat" energy, we love her anyway 🫢) and it's all about the kernel's device tree overlay notifier game, no cap.


✨ NAME ✨

of_overlay_notifier_register β€” register a notifier for overlay operations πŸŽ€

That's it. That's the whole vibe. You're signing a notifier up so it gets pinged whenever overlay stuff happens. Slay.


🌸 SYNOPSIS 🌸

int of_overlay_notifier_register (struct notifier_block *nb );

Like, that's the entire function signature. One arg. Very demure, very mindful. πŸ’œ


πŸ¦‹ ARGUMENTS πŸ¦‹

  • nb β€” the notifier block you want to register. That's the thing you're handing over so the kernel knows who to call. πŸ‘‘

⭐ DESCRIPTION ⭐

So here's what's actually happening, bestie: you call this and you're like "hey kernel, pls notify me about overlay operations on device tree nodes" and the kernel is like "say less" πŸ’… and now you're on the list.

The actions that get reported are the ones defined by of_reconfig_change. And here's the cute part β€” the notifier callback furthermore receives a pointer to the affected device tree node. So you don't just hear "something happened," you hear "something happened to this node." iconic. πŸ”₯

⚠️ okay now the serious bit, and I need you to actually read this one: a notifier callback is not supposed to store pointers to a device tree node or its content beyond OF_OVERLAY_POST_REMOVE corresponding to the respective node it received. Like, do not keep that pointer in your pocket and pull it out later expecting it to still be valid. That is not the move. The node's whole situation changes after that point and you will be holding a stale pointer and it will be a whole thing. 😭 So: use it during the callback, and after OF_OVERLAY_POST_REMOVE for that node? Let it go, bestie. Let it go. 🧚

πŸ’– SEE ALSO πŸ’–

Kernel file ./drivers/of/overlay.c β€” the source, obvi ✨

All of these are the supporting cast and honestly the whole ensemble ate. 🌈 Go read them, iykyk.


okay that's the page!! πŸŽ€ this little masterpiece lives in ./drivers/of and it's dated October 2026, so jot that down in your notes app bestie πŸ“βœ¨ mwah, go register your notifier responsibly, and remember: no storing stale node pointers. periodt. πŸ’…πŸ’–

πŸ“¦ where this page comes from