aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/process.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-09-25 20:03:17 -0400
committerGuenter Roeck <linux@roeck-us.net>2014-09-26 03:00:22 -0400
commit1a9607a3be14a43868c5e6a35962e7f6be9bcfe1 (patch)
treecd509ccd7eaf3c43a9c5379493a51b96061eada0 /arch/arm/kernel/process.c
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 <linux@roeck-us.net> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Heiko Stuebner <heiko@sntech.de> Cc: Arnd Bergmann <arnd@arndb.de> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jonas Jensen <jonas.jensen@gmail.com> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Randy Dunlap <rdunlap@infradead.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tomasz Figa <t.figa@samsung.com> Cc: Will Deacon <will.deacon@arm.com> Cc: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch/arm/kernel/process.c')
-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)
114 BUG(); 114 BUG();
115} 115}
116 116
117static void null_restart(enum reboot_mode reboot_mode, const char *cmd)
118{
119}
120
121/* 117/*
122 * Function pointers to optional machine specific functions 118 * Function pointers to optional machine specific functions
123 */ 119 */
124void (*pm_power_off)(void); 120void (*pm_power_off)(void);
125EXPORT_SYMBOL(pm_power_off); 121EXPORT_SYMBOL(pm_power_off);
126 122
127void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd) = null_restart; 123void (*arm_pm_restart)(enum reboot_mode reboot_mode, const char *cmd);
128EXPORT_SYMBOL_GPL(arm_pm_restart); 124EXPORT_SYMBOL_GPL(arm_pm_restart);
129 125
130/* 126/*
@@ -230,7 +226,10 @@ void machine_restart(char *cmd)
230 local_irq_disable(); 226 local_irq_disable();
231 smp_send_stop(); 227 smp_send_stop();
232 228
233 arm_pm_restart(reboot_mode, cmd); 229 if (arm_pm_restart)
230 arm_pm_restart(reboot_mode, cmd);
231 else
232 do_kernel_restart(cmd);
234 233
235 /* Give a grace period for failure to restart of 1s */ 234 /* Give a grace period for failure to restart of 1s */
236 mdelay(1000); 235 mdelay(1000);