diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2006-12-29 10:43:59 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-02-06 11:53:09 -0500 |
commit | c44e8d5e47b8ba672440b92eab0735628469116c (patch) | |
tree | f85364a9482003bf51e3cb10d0725ff3f57ce87c /arch/mips/mips-boards | |
parent | 2fa7937bd8922e1fe4aae6a45e7e787fa45d6043 (diff) |
[MIPS] prom_free_prom_memory cleanup
Current prom_free_prom_memory() implementations are almost same as
free_init_pages(), or no-op. Make free_init_pages() extern (again)
and make prom_free_prom_memory() use it.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards')
-rw-r--r-- | arch/mips/mips-boards/generic/memory.c | 18 | ||||
-rw-r--r-- | arch/mips/mips-boards/sim/sim_mem.c | 16 |
2 files changed, 7 insertions, 27 deletions
diff --git a/arch/mips/mips-boards/generic/memory.c b/arch/mips/mips-boards/generic/memory.c index eeed944e0f83..ebf0e16c5a0d 100644 --- a/arch/mips/mips-boards/generic/memory.c +++ b/arch/mips/mips-boards/generic/memory.c | |||
@@ -166,9 +166,8 @@ void __init prom_meminit(void) | |||
166 | } | 166 | } |
167 | } | 167 | } |
168 | 168 | ||
169 | unsigned long __init prom_free_prom_memory(void) | 169 | void __init prom_free_prom_memory(void) |
170 | { | 170 | { |
171 | unsigned long freed = 0; | ||
172 | unsigned long addr; | 171 | unsigned long addr; |
173 | int i; | 172 | int i; |
174 | 173 | ||
@@ -176,17 +175,8 @@ unsigned long __init prom_free_prom_memory(void) | |||
176 | if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA) | 175 | if (boot_mem_map.map[i].type != BOOT_MEM_ROM_DATA) |
177 | continue; | 176 | continue; |
178 | 177 | ||
179 | addr = PAGE_ALIGN(boot_mem_map.map[i].addr); | 178 | addr = boot_mem_map.map[i].addr; |
180 | while (addr < boot_mem_map.map[i].addr | 179 | free_init_pages("prom memory", |
181 | + boot_mem_map.map[i].size) { | 180 | addr, addr + boot_mem_map.map[i].size); |
182 | ClearPageReserved(virt_to_page(__va(addr))); | ||
183 | init_page_count(virt_to_page(__va(addr))); | ||
184 | free_page((unsigned long)__va(addr)); | ||
185 | addr += PAGE_SIZE; | ||
186 | freed += PAGE_SIZE; | ||
187 | } | ||
188 | } | 181 | } |
189 | printk("Freeing prom memory: %ldkb freed\n", freed >> 10); | ||
190 | |||
191 | return freed; | ||
192 | } | 182 | } |
diff --git a/arch/mips/mips-boards/sim/sim_mem.c b/arch/mips/mips-boards/sim/sim_mem.c index f7ce76983328..46bc16f8b15d 100644 --- a/arch/mips/mips-boards/sim/sim_mem.c +++ b/arch/mips/mips-boards/sim/sim_mem.c | |||
@@ -99,10 +99,9 @@ void __init prom_meminit(void) | |||
99 | } | 99 | } |
100 | } | 100 | } |
101 | 101 | ||
102 | unsigned long __init prom_free_prom_memory(void) | 102 | void __init prom_free_prom_memory(void) |
103 | { | 103 | { |
104 | int i; | 104 | int i; |
105 | unsigned long freed = 0; | ||
106 | unsigned long addr; | 105 | unsigned long addr; |
107 | 106 | ||
108 | for (i = 0; i < boot_mem_map.nr_map; i++) { | 107 | for (i = 0; i < boot_mem_map.nr_map; i++) { |
@@ -110,16 +109,7 @@ unsigned long __init prom_free_prom_memory(void) | |||
110 | continue; | 109 | continue; |
111 | 110 | ||
112 | addr = boot_mem_map.map[i].addr; | 111 | addr = boot_mem_map.map[i].addr; |
113 | while (addr < boot_mem_map.map[i].addr | 112 | free_init_pages("prom memory", |
114 | + boot_mem_map.map[i].size) { | 113 | addr, addr + boot_mem_map.map[i].size); |
115 | ClearPageReserved(virt_to_page(__va(addr))); | ||
116 | init_page_count(virt_to_page(__va(addr))); | ||
117 | free_page((unsigned long)__va(addr)); | ||
118 | addr += PAGE_SIZE; | ||
119 | freed += PAGE_SIZE; | ||
120 | } | ||
121 | } | 114 | } |
122 | printk("Freeing prom memory: %ldkb freed\n", freed >> 10); | ||
123 | |||
124 | return freed; | ||
125 | } | 115 | } |