register_platform_power_off(9)
Welcome to the Kernel API Manual, bestie π β this is the page for register_platform_power_off(9), and it is literally all about handing the kernel your platform-level power-off callback. no cap.
πΈ NAME πΈ
register_platform_power_off β Register platform-level power-off callback. Itβs giving βlast-resort shutdown behavior,β and honestly? iconic. π
β¨ SYNOPSIS β¨
int register_platform_power_off (void (*power_off)(void) );
π ARGUMENTS π
power_offβ Power-off callback. This is the callback that gets registered for power-off duty, and its signature is right there in the synopsis:void (*power_off)(void). π«Ά
π DESCRIPTION π
Okay so hereβs the tea: this registers a power_off callback that will be called as the last step of the power-off sequence, bestie. This callback is expected to be invoked for the last resort β like the final-final-final backup plan. No pressure or anything. ππ₯
Only one platform power-off callback is allowed to be registered at a time. One callback. Thatβs the whole roster. So donβt be out here trying to register a second one like itβs a group chat; the API said what it said. π
Return behavior: it returns 0 on success, or an error code on failure. If you get 0, slay β¨. If you get an error code, read it and handle your business, fr fr. π«‘
π SEE ALSO π
Kernel file: ./kernel/reboot.c β and the whole friend group is here:
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)devm_register_restart_handler(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)
mwah π β with love from the ./kernel source, October 2026 edition, aka the register_platform_power_off(9) page. π«Άβ¨
π¦ 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