diff options
author | Jeremy Kerr <jeremy.kerr@canonical.com> | 2010-01-11 17:17:34 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-15 16:39:13 -0500 |
commit | 2b0d8c251b8876d530a6bf671eb5425838fa698a (patch) | |
tree | f8b85d4ee0f76be6a45738452e91fbbb94602b4c /arch/arm/mm/mmu.c | |
parent | e119bfff1f102f8d1505910cd6c09df55c776b43 (diff) |
ARM: 5880/1: arm: use generic infrastructure for early params
The ARM setup code includes its own parser for early params, there's
also one in the generic init code.
This patch removes __early_init (and related code) from
arch/arm/kernel/setup.c, and changes users to the generic early_init
macro instead.
The generic macro takes a char * argument, rather than char **, so we
need to update the parser functions a little.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r-- | arch/arm/mm/mmu.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 1708da82da96..88f5d71248d9 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -100,18 +100,17 @@ static struct cachepolicy cache_policies[] __initdata = { | |||
100 | * writebuffer to be turned off. (Note: the write | 100 | * writebuffer to be turned off. (Note: the write |
101 | * buffer should not be on and the cache off). | 101 | * buffer should not be on and the cache off). |
102 | */ | 102 | */ |
103 | static void __init early_cachepolicy(char **p) | 103 | static int __init early_cachepolicy(char *p) |
104 | { | 104 | { |
105 | int i; | 105 | int i; |
106 | 106 | ||
107 | for (i = 0; i < ARRAY_SIZE(cache_policies); i++) { | 107 | for (i = 0; i < ARRAY_SIZE(cache_policies); i++) { |
108 | int len = strlen(cache_policies[i].policy); | 108 | int len = strlen(cache_policies[i].policy); |
109 | 109 | ||
110 | if (memcmp(*p, cache_policies[i].policy, len) == 0) { | 110 | if (memcmp(p, cache_policies[i].policy, len) == 0) { |
111 | cachepolicy = i; | 111 | cachepolicy = i; |
112 | cr_alignment &= ~cache_policies[i].cr_mask; | 112 | cr_alignment &= ~cache_policies[i].cr_mask; |
113 | cr_no_alignment &= ~cache_policies[i].cr_mask; | 113 | cr_no_alignment &= ~cache_policies[i].cr_mask; |
114 | *p += len; | ||
115 | break; | 114 | break; |
116 | } | 115 | } |
117 | } | 116 | } |
@@ -130,36 +129,37 @@ static void __init early_cachepolicy(char **p) | |||
130 | } | 129 | } |
131 | flush_cache_all(); | 130 | flush_cache_all(); |
132 | set_cr(cr_alignment); | 131 | set_cr(cr_alignment); |
132 | return 0; | ||
133 | } | 133 | } |
134 | __early_param("cachepolicy=", early_cachepolicy); | 134 | early_param("cachepolicy", early_cachepolicy); |
135 | 135 | ||
136 | static void __init early_nocache(char **__unused) | 136 | static int __init early_nocache(char *__unused) |
137 | { | 137 | { |
138 | char *p = "buffered"; | 138 | char *p = "buffered"; |
139 | printk(KERN_WARNING "nocache is deprecated; use cachepolicy=%s\n", p); | 139 | printk(KERN_WARNING "nocache is deprecated; use cachepolicy=%s\n", p); |
140 | early_cachepolicy(&p); | 140 | early_cachepolicy(p); |
141 | return 0; | ||
141 | } | 142 | } |
142 | __early_param("nocache", early_nocache); | 143 | early_param("nocache", early_nocache); |
143 | 144 | ||
144 | static void __init early_nowrite(char **__unused) | 145 | static int __init early_nowrite(char *__unused) |
145 | { | 146 | { |
146 | char *p = "uncached"; | 147 | char *p = "uncached"; |
147 | printk(KERN_WARNING "nowb is deprecated; use cachepolicy=%s\n", p); | 148 | printk(KERN_WARNING "nowb is deprecated; use cachepolicy=%s\n", p); |
148 | early_cachepolicy(&p); | 149 | early_cachepolicy(p); |
150 | return 0; | ||
149 | } | 151 | } |
150 | __early_param("nowb", early_nowrite); | 152 | early_param("nowb", early_nowrite); |
151 | 153 | ||
152 | static void __init early_ecc(char **p) | 154 | static int __init early_ecc(char *p) |
153 | { | 155 | { |
154 | if (memcmp(*p, "on", 2) == 0) { | 156 | if (memcmp(p, "on", 2) == 0) |
155 | ecc_mask = PMD_PROTECTION; | 157 | ecc_mask = PMD_PROTECTION; |
156 | *p += 2; | 158 | else if (memcmp(p, "off", 3) == 0) |
157 | } else if (memcmp(*p, "off", 3) == 0) { | ||
158 | ecc_mask = 0; | 159 | ecc_mask = 0; |
159 | *p += 3; | 160 | return 0; |
160 | } | ||
161 | } | 161 | } |
162 | __early_param("ecc=", early_ecc); | 162 | early_param("ecc", early_ecc); |
163 | 163 | ||
164 | static int __init noalign_setup(char *__unused) | 164 | static int __init noalign_setup(char *__unused) |
165 | { | 165 | { |
@@ -670,9 +670,9 @@ static unsigned long __initdata vmalloc_reserve = SZ_128M; | |||
670 | * bytes. This can be used to increase (or decrease) the vmalloc | 670 | * bytes. This can be used to increase (or decrease) the vmalloc |
671 | * area - the default is 128m. | 671 | * area - the default is 128m. |
672 | */ | 672 | */ |
673 | static void __init early_vmalloc(char **arg) | 673 | static int __init early_vmalloc(char *arg) |
674 | { | 674 | { |
675 | vmalloc_reserve = memparse(*arg, arg); | 675 | vmalloc_reserve = memparse(arg, NULL); |
676 | 676 | ||
677 | if (vmalloc_reserve < SZ_16M) { | 677 | if (vmalloc_reserve < SZ_16M) { |
678 | vmalloc_reserve = SZ_16M; | 678 | vmalloc_reserve = SZ_16M; |
@@ -687,8 +687,9 @@ static void __init early_vmalloc(char **arg) | |||
687 | "vmalloc area is too big, limiting to %luMB\n", | 687 | "vmalloc area is too big, limiting to %luMB\n", |
688 | vmalloc_reserve >> 20); | 688 | vmalloc_reserve >> 20); |
689 | } | 689 | } |
690 | return 0; | ||
690 | } | 691 | } |
691 | __early_param("vmalloc=", early_vmalloc); | 692 | early_param("vmalloc", early_vmalloc); |
692 | 693 | ||
693 | #define VMALLOC_MIN (void *)(VMALLOC_END - vmalloc_reserve) | 694 | #define VMALLOC_MIN (void *)(VMALLOC_END - vmalloc_reserve) |
694 | 695 | ||