Add do_kernel_power_off() helper that will remove open-coded pm_power_off invocations from the architecture code. This is the first step on the way to remove the global pm_power_off variable, which will allow us to implement consistent power-off chaining support.
Unified · Split
| @@ -63,6 +63,8 @@ extern void machine_shutdown(void); · 62 unmodified lines | |||
| 63 | struct pt_regs; | 63 | struct pt_regs; |
| 64 | extern void machine_crash_shutdown(struct pt_regs *); | 64 | extern void machine_crash_shutdown(struct pt_regs *); |
| 65 | 65 | ||
| 66 | void do_kernel_power_off(void); | ||
| 67 | |||
| 66 | /* | 68 | /* |
| 67 | * sys-off handler API. | 69 | * sys-off handler API. |
| 68 | */ | 70 | */ |
| @@ -504,6 +504,19 @@ static void do_kernel_power_off_prepare(void) · 503 unmodified lines | |||
| 504 | blocking_notifier_call_chain(&power_off_prep_handler_list, 0, NULL); | 504 | blocking_notifier_call_chain(&power_off_prep_handler_list, 0, NULL); |
| 505 | } | 505 | } |
| 506 | 506 | ||
| 507 | /** | ||
| 508 | * do_kernel_power_off - Execute kernel power-off handler call chain | ||
| 509 | * | ||
| 510 | * Expected to be called as last step of the power-off sequence. | ||
| 511 | * | ||
| 512 | * Powers off the system immediately if a power-off handler function has | ||
| 513 | * been registered. Otherwise does nothing. | ||
| 514 | */ | ||
| 515 | void do_kernel_power_off(void) | ||
| 516 | { | ||
| 517 | atomic_notifier_call_chain(&power_off_handler_list, 0, NULL); | ||
| 518 | } | ||
| 519 | |||
| 507 | /** | 520 | /** |
| 508 | * kernel_power_off - power_off the system | 521 | * kernel_power_off - power_off the system |
| 509 | * | 522 | * |