ARM: LMB: convert pfn_valid to use LMB

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Russell King 2010-07-01 12:03:29 +01:00
parent eda2e5dcc9
commit e07b9e0860
1 changed files with 4 additions and 5 deletions

View File

@ -239,16 +239,15 @@ static void __init arm_bootmem_free(struct meminfo *mi)
#ifndef CONFIG_SPARSEMEM #ifndef CONFIG_SPARSEMEM
int pfn_valid(unsigned long pfn) int pfn_valid(unsigned long pfn)
{ {
struct meminfo *mi = &meminfo; struct memblock_region *mem = &memblock.memory;
unsigned int left = 0, right = mi->nr_banks; unsigned int left = 0, right = mem->cnt;
do { do {
unsigned int mid = (right + left) / 2; unsigned int mid = (right + left) / 2;
struct membank *bank = &mi->bank[mid];
if (pfn < bank_pfn_start(bank)) if (pfn < memblock_start_pfn(mem, mid))
right = mid; right = mid;
else if (pfn >= bank_pfn_end(bank)) else if (pfn >= memblock_end_pfn(mem, mid))
left = mid + 1; left = mid + 1;
else else
return 1; return 1;