diff options
author | Paul Mackerras <paulus@samba.org> | 2005-12-04 23:50:39 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-08 22:51:30 -0500 |
commit | 54c233102f3680c7f08b6f06d229cc48503b79c4 (patch) | |
tree | 2c2bb4318031e7ddc1ccdbb75e5142f60eb2971f /arch/powerpc | |
parent | d2dd482bc17c3bc240045f80a7c4b4d5cea5e29c (diff) |
Revert "[PATCH] powerpc: Minor numa memory code cleanup"
This reverts f1fdc0117004d343698b9830e141491d5ae320d1 commit.
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/numa.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 30b5d6a1d838..ba7a3055a9fc 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -254,17 +254,29 @@ static int __init find_min_common_depth(void) | |||
254 | return depth; | 254 | return depth; |
255 | } | 255 | } |
256 | 256 | ||
257 | static void __init get_n_mem_cells(int *n_addr_cells, int *n_size_cells) | 257 | static int __init get_mem_addr_cells(void) |
258 | { | 258 | { |
259 | struct device_node *memory = NULL; | 259 | struct device_node *memory = NULL; |
260 | int rc; | ||
260 | 261 | ||
261 | memory = of_find_node_by_type(memory, "memory"); | 262 | memory = of_find_node_by_type(memory, "memory"); |
262 | if (memory) { | 263 | if (!memory) |
263 | *n_addr_cells = prom_n_addr_cells(memory); | 264 | return 0; /* it won't matter */ |
264 | *n_size_cells = prom_n_size_cells(memory); | 265 | |
265 | of_node_put(memory); | 266 | rc = prom_n_addr_cells(memory); |
266 | } | 267 | return rc; |
267 | /* if (!memory) we are in trouble, let other code error out */ | 268 | } |
269 | |||
270 | static int __init get_mem_size_cells(void) | ||
271 | { | ||
272 | struct device_node *memory = NULL; | ||
273 | int rc; | ||
274 | |||
275 | memory = of_find_node_by_type(memory, "memory"); | ||
276 | if (!memory) | ||
277 | return 0; /* it won't matter */ | ||
278 | rc = prom_n_size_cells(memory); | ||
279 | return rc; | ||
268 | } | 280 | } |
269 | 281 | ||
270 | static unsigned long __init read_n_cells(int n, unsigned int **buf) | 282 | static unsigned long __init read_n_cells(int n, unsigned int **buf) |
@@ -374,7 +386,7 @@ static int __init parse_numa_properties(void) | |||
374 | { | 386 | { |
375 | struct device_node *cpu = NULL; | 387 | struct device_node *cpu = NULL; |
376 | struct device_node *memory = NULL; | 388 | struct device_node *memory = NULL; |
377 | int n_addr_cells, n_size_cells; | 389 | int addr_cells, size_cells; |
378 | int max_domain; | 390 | int max_domain; |
379 | unsigned long i; | 391 | unsigned long i; |
380 | 392 | ||
@@ -413,7 +425,8 @@ static int __init parse_numa_properties(void) | |||
413 | } | 425 | } |
414 | } | 426 | } |
415 | 427 | ||
416 | get_n_mem_cells(&n_addr_cells, &n_size_cells); | 428 | addr_cells = get_mem_addr_cells(); |
429 | size_cells = get_mem_size_cells(); | ||
417 | memory = NULL; | 430 | memory = NULL; |
418 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { | 431 | while ((memory = of_find_node_by_type(memory, "memory")) != NULL) { |
419 | unsigned long start; | 432 | unsigned long start; |
@@ -430,8 +443,8 @@ static int __init parse_numa_properties(void) | |||
430 | ranges = memory->n_addrs; | 443 | ranges = memory->n_addrs; |
431 | new_range: | 444 | new_range: |
432 | /* these are order-sensitive, and modify the buffer pointer */ | 445 | /* these are order-sensitive, and modify the buffer pointer */ |
433 | start = read_n_cells(n_addr_cells, &memcell_buf); | 446 | start = read_n_cells(addr_cells, &memcell_buf); |
434 | size = read_n_cells(n_size_cells, &memcell_buf); | 447 | size = read_n_cells(size_cells, &memcell_buf); |
435 | 448 | ||
436 | numa_domain = of_node_numa_domain(memory); | 449 | numa_domain = of_node_numa_domain(memory); |
437 | 450 | ||