memblock/arm: Use new accessors

CC: Russell King <linux@arm.linux.org.uk>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 28be7072
...@@ -150,6 +150,7 @@ static void __init find_limits(struct meminfo *mi, ...@@ -150,6 +150,7 @@ static void __init find_limits(struct meminfo *mi,
static void __init arm_bootmem_init(struct meminfo *mi, static void __init arm_bootmem_init(struct meminfo *mi,
unsigned long start_pfn, unsigned long end_pfn) unsigned long start_pfn, unsigned long end_pfn)
{ {
struct memblock_region *reg;
unsigned int boot_pages; unsigned int boot_pages;
phys_addr_t bitmap; phys_addr_t bitmap;
pg_data_t *pgdat; pg_data_t *pgdat;
...@@ -180,13 +181,13 @@ static void __init arm_bootmem_init(struct meminfo *mi, ...@@ -180,13 +181,13 @@ static void __init arm_bootmem_init(struct meminfo *mi,
/* /*
* Reserve the memblock reserved regions in bootmem. * Reserve the memblock reserved regions in bootmem.
*/ */
for (i = 0; i < memblock.reserved.cnt; i++) { for_each_memblock(reserved, reg) {
phys_addr_t start = memblock_start_pfn(&memblock.reserved, i); phys_addr_t start = memblock_region_base_pfn(reg);
if (start >= start_pfn && phys_addr_t end = memblock_region_end_pfn(reg);
memblock_end_pfn(&memblock.reserved, i) <= end_pfn) if (start >= start_pfn && end <= end_pfn)
reserve_bootmem_node(pgdat, __pfn_to_phys(start), reserve_bootmem_node(pgdat, __pfn_to_phys(start),
memblock_size_bytes(&memblock.reserved, i), (end - start) << PAGE_SHIFT,
BOOTMEM_DEFAULT); BOOTMEM_DEFAULT);
} }
} }
...@@ -247,10 +248,12 @@ static void arm_memory_present(void) ...@@ -247,10 +248,12 @@ static void arm_memory_present(void)
#else #else
static void arm_memory_present(void) static void arm_memory_present(void)
{ {
struct memblock_region *reg;
int i; int i;
for (i = 0; i < memblock.memory.cnt; i++)
memory_present(0, memblock_start_pfn(&memblock.memory, i), for_each_memblock(memory, reg) {
memblock_end_pfn(&memblock.memory, i)); memory_present(0, memblock_region_base_pfn(reg),
memblock_region_end_pfn(reg));
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment