]> git.dujemihanovic.xyz Git - u-boot.git/commit
fdt_support: Add fdt_for_each_node_by_compatible() helper macro
authorMarek Behún <marek.behun@nic.cz>
Thu, 20 Jan 2022 00:04:42 +0000 (01:04 +0100)
committerStefan Roese <sr@denx.de>
Thu, 20 Jan 2022 10:35:29 +0000 (11:35 +0100)
commit3058e283b885d80fbaaaaed6f597a068188be948
tree3acad866dc7b75435b3bf1972ab7323257b707cc
parent068415eadefbbc81f14d4ce61fcf7a7eb39650d4
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>
16 files changed:
arch/arm/cpu/armv8/fsl-layerscape/fdt.c
arch/arm/cpu/armv8/fsl-layerscape/icid.c
arch/arm/mach-tegra/gpu.c
arch/mips/mach-octeon/octeon_fdt.c
arch/powerpc/cpu/mpc85xx/liodn.c
board/Marvell/octeon_ebb7304/board.c
board/congatec/cgtqmx8/spl.c
board/freescale/lx2160a/lx2160a.c
common/fdt_support.c
drivers/misc/fsl_portals.c
drivers/net/fm/fdt.c
drivers/pci/pcie_layerscape_fixup_common.c
drivers/phy/marvell/comphy_a3700.c
drivers/video/meson/simplefb_common.c
drivers/video/sunxi/simplefb_common.c
include/fdt_support.h