diff options
author | Shaohui Xie <Shaohui.Xie@freescale.com> | 2012-07-11 05:56:08 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2012-07-11 08:44:03 -0400 |
commit | c5f02bb422352ea6a272953e5ac7046111ddcd87 (patch) | |
tree | f66c23ebd0c896ed6a4cc0eb1d5fb6728e3a1aae /arch/powerpc/kernel | |
parent | b5dc2986879c2a6c65a3cfede7ba6de3531a0f3e (diff) |
powerpc/watchdog: move booke watchdog param related code to setup-common.c
Currently, BOOKE watchdog code for checking "wdt" and "wdt_period" is
in setup_32.c, it cannot be used in 64-bit, so move it to a common place
setup-common.c, which will be shared by 32-bit and 64-bit.
Also, replace the simple_strtoul with kstrtol.
Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/setup-common.c | 27 | ||||
-rw-r--r-- | arch/powerpc/kernel/setup_32.c | 24 |
2 files changed, 27 insertions, 24 deletions
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index afd4f051f3f2..bdc499c17872 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c | |||
@@ -720,6 +720,33 @@ static int powerpc_debugfs_init(void) | |||
720 | arch_initcall(powerpc_debugfs_init); | 720 | arch_initcall(powerpc_debugfs_init); |
721 | #endif | 721 | #endif |
722 | 722 | ||
723 | #ifdef CONFIG_BOOKE_WDT | ||
724 | extern u32 booke_wdt_enabled; | ||
725 | extern u32 booke_wdt_period; | ||
726 | |||
727 | /* Checks wdt=x and wdt_period=xx command-line option */ | ||
728 | notrace int __init early_parse_wdt(char *p) | ||
729 | { | ||
730 | if (p && strncmp(p, "0", 1) != 0) | ||
731 | booke_wdt_enabled = 1; | ||
732 | |||
733 | return 0; | ||
734 | } | ||
735 | early_param("wdt", early_parse_wdt); | ||
736 | |||
737 | int __init early_parse_wdt_period(char *p) | ||
738 | { | ||
739 | unsigned long ret; | ||
740 | if (p) { | ||
741 | if (!kstrtol(p, 0, &ret)) | ||
742 | booke_wdt_period = ret; | ||
743 | } | ||
744 | |||
745 | return 0; | ||
746 | } | ||
747 | early_param("wdt_period", early_parse_wdt_period); | ||
748 | #endif /* CONFIG_BOOKE_WDT */ | ||
749 | |||
723 | void ppc_printk_progress(char *s, unsigned short hex) | 750 | void ppc_printk_progress(char *s, unsigned short hex) |
724 | { | 751 | { |
725 | pr_info("%s\n", s); | 752 | pr_info("%s\n", s); |
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index ec8a53fa9e8f..a8f54ecb091f 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -149,30 +149,6 @@ notrace void __init machine_init(u64 dt_ptr) | |||
149 | ppc_md.progress("id mach(): done", 0x200); | 149 | ppc_md.progress("id mach(): done", 0x200); |
150 | } | 150 | } |
151 | 151 | ||
152 | #ifdef CONFIG_BOOKE_WDT | ||
153 | extern u32 booke_wdt_enabled; | ||
154 | extern u32 booke_wdt_period; | ||
155 | |||
156 | /* Checks wdt=x and wdt_period=xx command-line option */ | ||
157 | notrace int __init early_parse_wdt(char *p) | ||
158 | { | ||
159 | if (p && strncmp(p, "0", 1) != 0) | ||
160 | booke_wdt_enabled = 1; | ||
161 | |||
162 | return 0; | ||
163 | } | ||
164 | early_param("wdt", early_parse_wdt); | ||
165 | |||
166 | int __init early_parse_wdt_period (char *p) | ||
167 | { | ||
168 | if (p) | ||
169 | booke_wdt_period = simple_strtoul(p, NULL, 0); | ||
170 | |||
171 | return 0; | ||
172 | } | ||
173 | early_param("wdt_period", early_parse_wdt_period); | ||
174 | #endif /* CONFIG_BOOKE_WDT */ | ||
175 | |||
176 | /* Checks "l2cr=xxxx" command-line option */ | 152 | /* Checks "l2cr=xxxx" command-line option */ |
177 | int __init ppc_setup_l2cr(char *str) | 153 | int __init ppc_setup_l2cr(char *str) |
178 | { | 154 | { |