devm_regist..._off_handler(9)
π 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:
emergency_restart(9)register_reboot_notifier(9)unregister_reboot_notifier(9)register_restart_handler(9)unregister_restart_handler(9)do_kernel_restart(9)kernel_restart(9)kernel_halt(9)register_sys_off_handler(9)unregister_sys_off_handler(9)devm_register_sys_off_handler(9)devm_register_restart_handler(9)register_platform_power_off(9)unregister_platform_power_off(9)do_kernel_power_off(9)kernel_can_power_off(9)kernel_power_off(9)orderly_poweroff(9)orderly_reboot(9)hw_failure_emergency_action_func(9)hw_failure_emergency_schedule(9)__hw_protection_trigger(9)
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
- 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