mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 02:12:00 -04:00
um: register power-off handler
Otherwise we always get reboot: Power off not available: System halted instead which is really quite pointless. Link: https://patch.msgid.link/20240703173839.fcbb538c6686.I3d333f4773cff93c4337c4d128ee0b1b501b3dfa@changeid Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -59,3 +59,18 @@ void machine_halt(void)
|
||||
{
|
||||
machine_power_off();
|
||||
}
|
||||
|
||||
static int sys_power_off_handler(struct sys_off_data *data)
|
||||
{
|
||||
machine_power_off();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int register_power_off(void)
|
||||
{
|
||||
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
|
||||
SYS_OFF_PRIO_DEFAULT,
|
||||
sys_power_off_handler, NULL);
|
||||
return 0;
|
||||
}
|
||||
__initcall(register_power_off);
|
||||
|
||||
Reference in New Issue
Block a user