Commit f7b9ebb7 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Michael Ellerman

powerpc: Re-order setup_panic()

Do it right after probe_machine() since it's about testing ppc_md,
and put the test in the common code.
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent e39afba3
...@@ -688,6 +688,8 @@ static struct notifier_block ppc_panic_block = { ...@@ -688,6 +688,8 @@ static struct notifier_block ppc_panic_block = {
void __init setup_panic(void) void __init setup_panic(void)
{ {
if (!ppc_md.panic)
return;
atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block); atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
} }
......
...@@ -277,6 +277,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -277,6 +277,8 @@ void __init setup_arch(char **cmdline_p)
probe_machine(); probe_machine();
setup_panic();
setup_power_save(); setup_power_save();
find_legacy_serial_ports(); find_legacy_serial_ports();
...@@ -288,9 +290,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -288,9 +290,6 @@ void __init setup_arch(char **cmdline_p)
xmon_setup(); xmon_setup();
if (ppc_md.panic)
setup_panic();
init_mm.start_code = (unsigned long)_stext; init_mm.start_code = (unsigned long)_stext;
init_mm.end_code = (unsigned long) _etext; init_mm.end_code = (unsigned long) _etext;
init_mm.end_data = (unsigned long) _edata; init_mm.end_data = (unsigned long) _edata;
......
...@@ -649,6 +649,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -649,6 +649,8 @@ void __init setup_arch(char **cmdline_p)
/* Probe the machine type */ /* Probe the machine type */
probe_machine(); probe_machine();
setup_panic();
/* /*
* We can discover serial ports now since the above did setup the * We can discover serial ports now since the above did setup the
* hash table management for us, thus ioremap works. We do that early * hash table management for us, thus ioremap works. We do that early
...@@ -696,9 +698,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -696,9 +698,6 @@ void __init setup_arch(char **cmdline_p)
*/ */
reserve_hugetlb_gpages(); reserve_hugetlb_gpages();
if (ppc_md.panic)
setup_panic();
klp_init_thread_info(&init_thread_info); klp_init_thread_info(&init_thread_info);
init_mm.start_code = (unsigned long)_stext; init_mm.start_code = (unsigned long)_stext;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment