mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 18:35:42 +01:00 
			
		
		
		
	dm: core: Add a way to find an ofnode by compatible string
Add an ofnode_by_compatible() to allow iterating through ofnodes with a given compatible string. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		| @@ -729,3 +729,15 @@ int ofnode_device_is_compatible(ofnode node, const char *compat) | ||||
| 						  ofnode_to_offset(node), | ||||
| 						  compat); | ||||
| } | ||||
|  | ||||
| ofnode ofnode_by_compatible(ofnode from, const char *compat) | ||||
| { | ||||
| 	if (of_live_active()) { | ||||
| 		return np_to_ofnode(of_find_compatible_node( | ||||
| 			(struct device_node *)ofnode_to_np(from), NULL, | ||||
| 			compat)); | ||||
| 	} else { | ||||
| 		return offset_to_ofnode(fdt_node_offset_by_compatible( | ||||
| 				gd->fdt_blob, ofnode_to_offset(from), compat)); | ||||
| 	} | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user