devm_regist..._off_handler(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay bestie, welcome to the Kernel API Manual ✨ this one's all about devm_register_sys_off_handler β€” the resource-managed way to sign your device up for the whole "system is going bye-bye" moment. no cap, it's lowkey iconic.


✨ NAME ✨

devm_register_sys_off_handler β€” register a sys-off handler πŸŽ€


🌸 SYNOPSIS 🌸

int devm_register_sys_off_handler (struct device *dev , enum
sys_off_mode mode , int priority , int (*callback)(struct sys_off_data
*data) , void *cb_data );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” the device that's registering the handler 🫢 like, this is who's claiming it
  • mode β€” sys-off mode πŸ’…
  • priority β€” handler priority, so the important ones go first, obviously
  • callback β€” the callback function ⭐ this is the main character that actually runs
  • cb_data β€” callback argument, the lil bundle of stuff you hand to callback

πŸ’œ DESCRIPTION πŸ’œ

Registers a resource-managed sys-off handler. the "resource-managed" part is the whole vibe β€” it's tied to dev and gets cleaned up for you, iykyk πŸ”₯

Returns zero on success, or an error code on failure. so like, 0 = slay, anything else = check the code, bestie 😭


🌈 SEE ALSO 🌈

all from the kernel file ./kernel/reboot.c β€” go read the whole friend group:


okay that's the whole page, mwah πŸ’‹ this one lives in ./kernel, dated October 2026 β€” same manual name, same date, no notes. periodt. πŸ‘‘

πŸ“¦ where this page comes from