mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-09-04 20:19:47 +08:00 
			
		
		
		
	of: use for_each_of_cpu_node iterator
Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This has the side effect of defaulting to iterating using "cpu" node names in preference to the deprecated (for FDT) device_type == "cpu". Cc: Frank Rowand <frowand.list@gmail.com> Cc: devicetree@vger.kernel.org Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
		
							parent
							
								
									a9a455e854
								
							
						
					
					
						commit
						651d44f967
					
				| @ -389,7 +389,7 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) | |||||||
| { | { | ||||||
| 	struct device_node *cpun; | 	struct device_node *cpun; | ||||||
| 
 | 
 | ||||||
| 	for_each_node_by_type(cpun, "cpu") { | 	for_each_of_cpu_node(cpun) { | ||||||
| 		if (arch_find_n_match_cpu_physical_id(cpun, cpu, thread)) | 		if (arch_find_n_match_cpu_physical_id(cpun, cpu, thread)) | ||||||
| 			return cpun; | 			return cpun; | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -24,18 +24,9 @@ static void __init of_numa_parse_cpu_nodes(void) | |||||||
| { | { | ||||||
| 	u32 nid; | 	u32 nid; | ||||||
| 	int r; | 	int r; | ||||||
| 	struct device_node *cpus; | 	struct device_node *np; | ||||||
| 	struct device_node *np = NULL; |  | ||||||
| 
 |  | ||||||
| 	cpus = of_find_node_by_path("/cpus"); |  | ||||||
| 	if (!cpus) |  | ||||||
| 		return; |  | ||||||
| 
 |  | ||||||
| 	for_each_child_of_node(cpus, np) { |  | ||||||
| 		/* Skip things that are not CPUs */ |  | ||||||
| 		if (of_node_cmp(np->type, "cpu") != 0) |  | ||||||
| 			continue; |  | ||||||
| 
 | 
 | ||||||
|  | 	for_each_of_cpu_node(np) { | ||||||
| 		r = of_property_read_u32(np, "numa-node-id", &nid); | 		r = of_property_read_u32(np, "numa-node-id", &nid); | ||||||
| 		if (r) | 		if (r) | ||||||
| 			continue; | 			continue; | ||||||
| @ -46,8 +37,6 @@ static void __init of_numa_parse_cpu_nodes(void) | |||||||
| 		else | 		else | ||||||
| 			node_set(nid, numa_nodes_parsed); | 			node_set(nid, numa_nodes_parsed); | ||||||
| 	} | 	} | ||||||
| 
 |  | ||||||
| 	of_node_put(cpus); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static int __init of_numa_parse_memory_nodes(void) | static int __init of_numa_parse_memory_nodes(void) | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Rob Herring
						Rob Herring