| .. | .. |
|---|
| 24 | 24 | { |
|---|
| 25 | 25 | u32 nid; |
|---|
| 26 | 26 | int r; |
|---|
| 27 | | - struct device_node *cpus; |
|---|
| 28 | | - struct device_node *np = NULL; |
|---|
| 27 | + struct device_node *np; |
|---|
| 29 | 28 | |
|---|
| 30 | | - cpus = of_find_node_by_path("/cpus"); |
|---|
| 31 | | - if (!cpus) |
|---|
| 32 | | - return; |
|---|
| 33 | | - |
|---|
| 34 | | - for_each_child_of_node(cpus, np) { |
|---|
| 35 | | - /* Skip things that are not CPUs */ |
|---|
| 36 | | - if (of_node_cmp(np->type, "cpu") != 0) |
|---|
| 37 | | - continue; |
|---|
| 38 | | - |
|---|
| 29 | + for_each_of_cpu_node(np) { |
|---|
| 39 | 30 | r = of_property_read_u32(np, "numa-node-id", &nid); |
|---|
| 40 | 31 | if (r) |
|---|
| 41 | 32 | continue; |
|---|
| .. | .. |
|---|
| 46 | 37 | else |
|---|
| 47 | 38 | node_set(nid, numa_nodes_parsed); |
|---|
| 48 | 39 | } |
|---|
| 49 | | - |
|---|
| 50 | | - of_node_put(cpus); |
|---|
| 51 | 40 | } |
|---|
| 52 | 41 | |
|---|
| 53 | 42 | static int __init of_numa_parse_memory_nodes(void) |
|---|