diff options
author | Marek BehĂșn <marek.behun@nic.cz> | 2022-01-20 01:04:42 +0100 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-01-20 11:35:29 +0100 |
commit | 3058e283b885d80fbaaaaed6f597a068188be948 (patch) | |
tree | 3acad866dc7b75435b3bf1972ab7323257b707cc /drivers/net/fm | |
parent | 068415eadefbbc81f14d4ce61fcf7a7eb39650d4 (diff) | |
download | u-boot-3058e283b885d80fbaaaaed6f597a068188be948.zip u-boot-3058e283b885d80fbaaaaed6f597a068188be948.tar.gz u-boot-3058e283b885d80fbaaaaed6f597a068188be948.tar.bz2 |
fdt_support: Add fdt_for_each_node_by_compatible() helper macro
Add macro fdt_for_each_node_by_compatible() to allow iterating over
fdt nodes by compatible string.
Convert various usages of
off = fdt_node_offset_by_compatible(fdt, start, compat);
while (off > 0) {
code();
off = fdt_node_offset_by_compatible(fdt, off, compat);
}
and similar, to
fdt_for_each_node_by_compatible(off, fdt, start, compat)
code();
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/net/fm')
-rw-r--r-- | drivers/net/fm/fdt.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/fm/fdt.c b/drivers/net/fm/fdt.c index 3855d7d..9828753 100644 --- a/drivers/net/fm/fdt.c +++ b/drivers/net/fm/fdt.c @@ -115,8 +115,7 @@ void fdt_fixup_fman_firmware(void *blob) } /* Find all other Fman nodes and point them to the firmware node. */ - while ((fmnode = fdt_node_offset_by_compatible(blob, fmnode, - "fsl,fman")) > 0) { + fdt_for_each_node_by_compatible(fmnode, blob, fmnode, "fsl,fman") { rc = fdt_setprop_cell(blob, fmnode, "fsl,firmware-phandle", phandle); if (rc < 0) { |