Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: fdt: Remove early_init_dt_reserve_memory_arch() override capability

Commit e7ae8d174eec0b3b ("MIPS: replace add_memory_region with
memblock") removed the last architecture-specific override of
early_init_dt_reserve_memory_arch().
Convert the common implementation from a weak global function to a
static function.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/be0140a0183ecfd0a3afa4fe6d2d77ed418102f9.1628671897.git.geert+renesas@glider.be
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Geert Uytterhoeven and committed by
Rob Herring
18250b43 6b2117ad

+16 -18
+16 -16
drivers/of/fdt.c
··· 475 475 476 476 static u32 of_fdt_crc32; 477 477 478 + static int __init early_init_dt_reserve_memory_arch(phys_addr_t base, 479 + phys_addr_t size, bool nomap) 480 + { 481 + if (nomap) { 482 + /* 483 + * If the memory is already reserved (by another region), we 484 + * should not allow it to be marked nomap. 485 + */ 486 + if (memblock_is_region_reserved(base, size)) 487 + return -EBUSY; 488 + 489 + return memblock_mark_nomap(base, size); 490 + } 491 + return memblock_reserve(base, size); 492 + } 493 + 478 494 /* 479 495 * __reserved_mem_reserve_reg() - reserve all memory described in 'reg' property 480 496 */ ··· 1161 1145 int __init __weak early_init_dt_mark_hotplug_memory_arch(u64 base, u64 size) 1162 1146 { 1163 1147 return memblock_mark_hotplug(base, size); 1164 - } 1165 - 1166 - int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base, 1167 - phys_addr_t size, bool nomap) 1168 - { 1169 - if (nomap) { 1170 - /* 1171 - * If the memory is already reserved (by another region), we 1172 - * should not allow it to be marked nomap. 1173 - */ 1174 - if (memblock_is_region_reserved(base, size)) 1175 - return -EBUSY; 1176 - 1177 - return memblock_mark_nomap(base, size); 1178 - } 1179 - return memblock_reserve(base, size); 1180 1148 } 1181 1149 1182 1150 static void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
-2
include/linux/of_fdt.h
··· 68 68 extern void __init early_init_dt_scan_chosen_arch(unsigned long node); 69 69 extern void early_init_dt_add_memory_arch(u64 base, u64 size); 70 70 extern int early_init_dt_mark_hotplug_memory_arch(u64 base, u64 size); 71 - extern int early_init_dt_reserve_memory_arch(phys_addr_t base, phys_addr_t size, 72 - bool no_map); 73 71 extern u64 dt_mem_next_cell(int s, const __be32 **cellp); 74 72 75 73 /* Early flat tree scan hooks */