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 /arch/arm/mach-tegra | |
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 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/gpu.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/gpu.c b/arch/arm/mach-tegra/gpu.c index 13ffade..36538e7 100644 --- a/arch/arm/mach-tegra/gpu.c +++ b/arch/arm/mach-tegra/gpu.c @@ -46,11 +46,8 @@ int tegra_gpu_enable_node(void *blob, const char *compat) if (!_configured) return 0; - offset = fdt_node_offset_by_compatible(blob, -1, compat); - while (offset != -FDT_ERR_NOTFOUND) { + fdt_for_each_node_by_compatible(offset, blob, -1, compat) fdt_status_okay(blob, offset); - offset = fdt_node_offset_by_compatible(blob, offset, compat); - } return 0; } |