[PATCH 2/2] kernel / reboot: Remove the pm_power_off_prepare hook
From: Baolin Wang
Date: Wed Mar 21 2018 - 07:30:54 EST
There are no users will prepare to power off system by 'pm_power_off_prepare'
hook, thus we can remove it now.
Signed-off-by: Baolin Wang <baolin.wang@xxxxxxxxxx>
---
include/linux/pm.h | 1 -
kernel/reboot.c | 8 --------
2 files changed, 9 deletions(-)
diff --git a/include/linux/pm.h b/include/linux/pm.h
index e723b78..cff7668 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -32,7 +32,6 @@
* Callbacks for platform drivers to implement.
*/
extern void (*pm_power_off)(void);
-extern void (*pm_power_off_prepare)(void);
struct device; /* we have a circular dep with device.h */
#ifdef CONFIG_VT_CONSOLE_SLEEP
diff --git a/kernel/reboot.c b/kernel/reboot.c
index e4ced88..6667b63 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -44,12 +44,6 @@
enum reboot_type reboot_type = BOOT_ACPI;
int reboot_force;
-/*
- * If set, this is used for preparing the system to power off.
- */
-
-void (*pm_power_off_prepare)(void);
-
/**
* emergency_restart - reboot the system
*
@@ -284,8 +278,6 @@ void kernel_halt(void)
void kernel_power_off(void)
{
kernel_shutdown_prepare(SYSTEM_POWER_OFF);
- if (pm_power_off_prepare)
- pm_power_off_prepare();
migrate_to_reboot_cpu();
syscore_shutdown();
pr_emerg("Power down\n");
--
1.7.9.5