aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Roeck <[email protected]>2014-09-26 00:03:17 +0000
committerGuenter Roeck <[email protected]>2014-09-26 00:00:22 -0700
commit1a9607a3be14a43868c5e6a35962e7f6be9bcfe1 (patch)
treecd509ccd7eaf3c43a9c5379493a51b96061eada0
parent1c7ffc32eaadfae3e7ab106359af0cf21b7e94c1 (diff)
arm: support restart through restart handler call chain
The kernel core now supports a restart handler call chain for system restart functions. With this change, the arm_pm_restart callback is now optional, so drop its initialization and check if it is set before calling it. Only call the kernel restart handler if arm_pm_restart is not set. Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Catalin Marinas <[email protected]> Acked-by: Heiko Stuebner <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Dmitry Eremin-Solenikov <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jonas Jensen <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Russell King <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Tomasz Figa <[email protected]> Cc: Will Deacon <[email protected]> Cc: Wim Van Sebroeck <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--arch/arm/kernel/process.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 81ef686a91ca..ea279f7a8767 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -114,17 +114,13 @@ void soft_restart(unsigned long addr)
BUG();
}
-static void null_restart(enum reboot_mode reboot_mode, const char *cmd)
-{
-}
-
/*
* Function pointers to optional machine specific functions
*/
void (*pm_power_off)(void);
EXPORT_SYMBOL(pm_power_off);
-void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd) = null_restart;
+void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
EXPORT_SYMBOL_GPL(arm_pm_restart);
/*
@@ -230,7 +226,10 @@ void machine_restart(char *cmd)
local_irq_disable();
smp_send_stop();
- arm_pm_restart(reboot_mode, cmd);
+ if (arm_pm_restart)
+ arm_pm_restart(reboot_mode, cmd);
+ else
+ do_kernel_restart(cmd);
/* Give a grace period for failure to restart of 1s */
mdelay(1000);