of_overlay_n...ier_register(9)
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 beyondOF_OVERLAY_POST_REMOVEcorresponding 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 afterOF_OVERLAY_POST_REMOVEfor that node? Let it go, bestie. Let it go. π§
π SEE ALSO π
Kernel file ./drivers/of/overlay.c β the source, obvi β¨
struct target(9)struct fragment(9)struct overlay_changeset(9)of_overlay_notifier_unregister(9)add_changeset_property(9)add_changeset_node(9)build_changeset_next_level(9)changeset_dup_entry_check(9)build_changeset(9)init_overlay_changeset(9)of_overlay_fdt_apply(9)of_overlay_remove(9)of_overlay_remove_all(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms