aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-07-01 07:03:29 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-27 03:48:24 -0400
commite07b9e08601b400aee7e076e7b31799d3dd48c1e (patch)
tree28a030ef024bb5677546c8a6dad2769176bb0545 /arch/arm/mm/init.c
parenteda2e5dcc914b4d70f665443efc9780e89a5e5c1 (diff)
ARM: LMB: convert pfn_valid to use LMB
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r--arch/arm/mm/init.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index a453982fdcef..c357bfb464ae 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -239,16 +239,15 @@ static void __init arm_bootmem_free(struct meminfo *mi)
239#ifndef CONFIG_SPARSEMEM 239#ifndef CONFIG_SPARSEMEM
240int pfn_valid(unsigned long pfn) 240int pfn_valid(unsigned long pfn)
241{ 241{
242 struct meminfo *mi = &meminfo; 242 struct memblock_region *mem = &memblock.memory;
243 unsigned int left = 0, right = mi->nr_banks; 243 unsigned int left = 0, right = mem->cnt;
244 244
245 do { 245 do {
246 unsigned int mid = (right + left) / 2; 246 unsigned int mid = (right + left) / 2;
247 struct membank *bank = &mi->bank[mid];
248 247
249 if (pfn < bank_pfn_start(bank)) 248 if (pfn < memblock_start_pfn(mem, mid))
250 right = mid; 249 right = mid;
251 else if (pfn >= bank_pfn_end(bank)) 250 else if (pfn >= memblock_end_pfn(mem, mid))
252 left = mid + 1; 251 left = mid + 1;
253 else 252 else
254 return 1; 253 return 1;