devm_regist...tart_handler(9)
π devm_register_restart_handler(9) β like, the Kernel API Manual, bestie β¨
Okay so we're in the Kernel API Manual today and honestly? This one's a little icon. It's a resource-managed restart handler registration situation and it literally does your cleanup for you. Main character energy fr fr. π
β¨ NAME β¨
devm_register_restart_handler β Register restart handler π¦
πΈ SYNOPSIS πΈ
int devm_register_restart_handler (struct device *dev , int
(*callback)(struct sys_off_data *data) , void *cb_data );
π ARGUMENTS π
devβ the Device that registers the callback. it's giving "who's the parent here" vibes πcallbackβ the Callback function. the one that actually does the thing, no cap π₯cb_dataβ the Callback's argument. lil' care package for your callback π
β DESCRIPTION β
So what it does is: registers a resource-managed sys-off handler with a default priority, and it's using restart mode. πβ¨
Returns zero on success, or an error code on failure. That's it. That's the whole vibe check. π
π SEE ALSO π
Kernel file ./kernel/reboot.c β and like, the whole friend group:
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_power_off_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)
and that's the page!! π«Ά source situation is ./kernel, dated October 2026, and the page name is devm_regist...tart_handler(9) β she's got a truncated name and she's still slaying ππ byeee bestie, go reboot something responsibly πΈβ¨
π¦ 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