Skip to content

Commit 86abcd6

Browse files
committed
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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 824ac4a commit 86abcd6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

arch/um/kernel/reboot.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,18 @@ void machine_halt(void)
5959
{
6060
machine_power_off();
6161
}
62+
63+
static int sys_power_off_handler(struct sys_off_data *data)
64+
{
65+
machine_power_off();
66+
return 0;
67+
}
68+
69+
static int register_power_off(void)
70+
{
71+
register_sys_off_handler(SYS_OFF_MODE_POWER_OFF,
72+
SYS_OFF_PRIO_DEFAULT,
73+
sys_power_off_handler, NULL);
74+
return 0;
75+
}
76+
__initcall(register_power_off);

0 commit comments

Comments
 (0)