devm_regist..._off_handler(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… devm_regist..._off_handler(9)

okay so bestie, welcome to the Kernel API Manual ✨ this one's a lil page about devm_register_power_off_handler, which is genuinely such a slay little helper β€” it's giving "I'll clean up after myself" energy and honestly? obsessed 🫢


🌸 NAME 🌸

devm_register_power_off_handler β€” register a power-off handler πŸŽ€


✨ SYNOPSIS ✨

int devm_register_power_off_handler (struct device *dev , int
(*callback)(struct sys_off_data *data) , void *cb_data );

like, that's the whole signature, no notes πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device that registers the callback, aka the main character here πŸ‘‘
  • callback β€” the callback function itself, the lil function that gets the job done ⭐
  • cb_data β€” the callback's argument, its emotional support object fr fr πŸ’–

🌈 DESCRIPTION 🌈

So what it does: it registers a resource-managed sys-off handler, with a default priority, and it uses power-off mode. That's the whole vibe ✨

And the return? It returns zero on success, or an error code on failure 😭 so like, check that return value, bestie, don't just ignore it.


πŸŽ€ SEE ALSO πŸŽ€

this list is long and honestly iconic β€” it's the whole reboot/power-off friend group 🌸 the kernel file in question is ./kernel/reboot.c, and here's everyone:

go read them all, iykylk πŸ’œ


no cap, that's genuinely everything on the page β€” every argument, every sibling function, all of it. not me being thorough πŸ’…

and that's the tea πŸ“ this page lives in ./kernel, dated October 2026, from the Kernel API Manual β€” mwah, bye bestie πŸ§šπŸ’–

πŸ“¦ where this page comes from