mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-21 20:14:29 +00:00
feat(fdt): add for_each_compatible_node macro
This macro enables users to go through dts nodes that have a particular compatible string in its node attribute. Signed-off-by: Laurent Carlier <laurent.carlier@arm.com> Change-Id: Id80cbe6f6057076e0d53905cdc0f9a44e79960f8
This commit is contained in:
parent
ab5964aadc
commit
ff766148b5
1 changed files with 5 additions and 0 deletions
|
@ -48,4 +48,9 @@ static inline uint32_t fdt_blob_size(const void *dtb)
|
||||||
return fdt32_to_cpu(dtb_header[1]);
|
return fdt32_to_cpu(dtb_header[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define fdt_for_each_compatible_node(dtb, node, compatible_str) \
|
||||||
|
for (node = fdt_node_offset_by_compatible(dtb, -1, compatible_str); \
|
||||||
|
node >= 0; \
|
||||||
|
node = fdt_node_offset_by_compatible(dtb, node, compatible_str))
|
||||||
|
|
||||||
#endif /* FDT_WRAPPERS_H */
|
#endif /* FDT_WRAPPERS_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue